cyt4321 发表于 2004-9-29 11:11:00

[求助]用VBA如何调出CAD的颜色属性对话框,之后,如何获得所选的颜色号

<FONT face=宋体>斑竹和各位大侠:</FONT>


<FONT face=宋体>                       用VBA如何调出CAD的颜色属性对话框,之后,如何获得所选的颜色号。能不能与lisp结合得到呢?请给个例子。谢了!</B></FONT>

alin 发表于 2004-9-29 19:20:00

Reply From: Oquendo, Frank <BR>Date: Jul/13/00 - 18:18 (GMT) <BR>               <BR>Re: Using the Color Dialog<BR>I don't know about the File dialog (maybe GETFILED will work) but I do know<BR>that you can use the VisualLISP ActiveX Module to call the ACAD_COLORDLG<BR>function and receive its return value. If you're not familiar with the<BR>VisualLISP ActiveX Module, I have a free wrapper class in the download<BR>section of my web site. It's called VLAX (pretty original, huh?) Using it,<BR>you can call the color dialog like so:


Dim objVLAX As New VLAX, retVal<BR>retVal = objVLAX.EvalLispExpression("(acad_colordlg 3 nil)")


Be sure to add the class module to your project and also be sure to type<BR>(VL-LOAD-COM) at the command line before running.

wyj7485 发表于 2004-9-30 09:58:00

Private Declare Function acedSetColorDialog Lib _<BR>               "acad.exe" (color As Long, ByVal bAllowMetaColor _<BR>               As Boolean, ByVal nCurLayerColor As Long) As Boolean


Public Function ChooseColor(ByVal lngInitClr As Long, _<BR>ByVal blnMetaColor As Boolean, _<BR>ByVal lngCurClr As Long) As Long<BR>ChooseColor = -1<BR>On Error Resume Next<BR>If acedSetColorDialog(lngInitClr, blnMetaColor, lngCurClr) Then<BR>ChooseColor = lngInitClr<BR>End If<BR>On Error GoTo 0<BR>End Function

cyt4321 发表于 2004-9-30 10:11:00

谢了!
页: [1]
查看完整版本: [求助]用VBA如何调出CAD的颜色属性对话框,之后,如何获得所选的颜色号