'By Kevin Terry Option Explicit Private Declare Function acedSetColorDialog Lib _ "acad.exe" (color As Long, ByVal bAllowMetaColor _ As Boolean, ByVal nCurLayerColor As Long) As Boolean 'Color choice using autocad color selection dialog box ' Public Function ChooseColor(ByVal lngInitClr As Long, ByVal blnMetaColor As Boolean, _ ByVal lngCurClr As Long) As Long ChooseColor = -1 On Error Resume Next If acedSetColorDialog(lngInitClr, blnMetaColor, lngCurClr) Then ChooseColor = lngInitClr End If On Error GoTo 0 End Function Public Sub test() Dim lColor As Long lColor = ChooseColor(lColor, True, lColor) MsgBox "You have selected color " & lColor End Sub
|