Load Color Palette

Discussion in 'AutoCAD' started by JLO, Jan 22, 2004.

  1. JLO

    JLO Guest

    Hello.
    i'd like to load the AutoCad Color Palette, select a color and get the Color
    number into a Variable.
    How Could i do it??
    thanks for your help!!!
     
    JLO, Jan 22, 2004
    #1
  2. JLO

    Ed Jobe Guest

    This is my way. It requires vlax.cls from www.acadx.com.


    Public Function AcadColorDialog() As Integer
    'calls the acad color dialog and returns
    'the index of the color selected or -1 if cancelled
    Dim i As Integer
    Dim vl As New VLAX

    'call color dialog
    vl.EvalLispExpression ("(setq clr (acad_colordlg 1))")
    'if dialog was canceled, clr will be nil, set to -1 instead
    i = vl.EvalLispExpression("(if (= clr nil)(setq clr -1)(setq clr clr))")
    AcadColorDialog = i
    Set vl = Nothing
    End Function
     
    Ed Jobe, Jan 23, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.