Fred,
You need to be careful with that function. Since it utilizes SendCommnad,
its likely you will not get the correct value. Use the vlisp interface to
set the sysvar. Better yet use the vlisp interface to return the value
directly to vba.
--
----
Ed
----
wrote in message news:5020375@discussion.autodesk.com...
Kenneth ,
There is no Acad color library, but you can use the Acad Color
selector used in the layer manager.
I got this Lisp routine from someone on this group. This is any easy way to
show the color dialog box and get the value of the color selected from lisp
to VBA using USERI5 variable.
Search this group for USERI if you do not know about these acad internal
variables.
Public Function ColorDialog() As Integer
Dim intVariable As Integer
If Connect Then
objAcad.Application.WindowState = acMin
'calls the acad color dialog and returns
'the index of the color selected or -1 if cancelled
'store current sysvar value
intVariable = ThisDrawing1.GetVariable("USERI5")
'call color dialog
ThisDrawing1.SendCommand ("(setq clr (acad_colordlg 1))" & vbCr)
ThisDrawing1.SendCommand ("(if (= clr nil)" & _
"(setvar ""USERI5"" -1)" & _
"(setvar ""USERI5"" clr))" & vbCr)
ColorDialog = ThisDrawing1.GetVariable("USERI5")
'reset sysvar
ThisDrawing1.SetVariable "USERI5", intVariable
End If
Fred C.