Color By Selection

Discussion in 'AutoCAD' started by Tim, Jul 21, 2004.

  1. Tim

    Tim Guest

    I have a routine that allows me to select all of the objects of a particular
    color (not bylayer) and change them with a color number of your choosing.
    What I want to be able to do is to call the color dialog box and pass the
    color selected as a variable to finish the routine. I tried (command
    "color")
    but that only changes the color for new objects created.

    Any ideas

    Thanks


    Tim W.
     
    Tim, Jul 21, 2004
    #1
  2. Tim

    ECCAD Guest

    ;; Get a Color Selection..
    (defun g_col ( / ocol )
    (initdia)
    (setq ocol (getvar "cecolor"))
    (command "color"); user picks one..
    (setq col (getvar "cecolor")); pick up that color..
    (setvar "cecolor" ocol)
    (princ)
    ); function
    ..............
    Variable col has the color number..
    Bob
     
    ECCAD, Jul 21, 2004
    #2
  3. Tim

    Jim Claypool Guest

    (setq clr (acad_colordlg 7)) ;will start the dialog with a default color of
    7. clr will hold the color of choice
     
    Jim Claypool, Jul 21, 2004
    #3
  4. Tim

    Tim Guest

    Thanks Jim Works great..:)
    where can I find the dialog references?

    Tim W.
     
    Tim, Jul 21, 2004
    #4
  5. Tim

    Jim Claypool Guest

    acad_dev.chm in the help folder

     
    Jim Claypool, Jul 21, 2004
    #5
  6. Tim

    Tim Guest

    Okay thanks

    Tim W.

     
    Tim, Jul 21, 2004
    #6
  7. Tim

    Jürg Menzi Guest

    Hi Tim

    If you are using A2k4+, you can use 'acad_truecolordlg'. For details search
    in AutoCAD folder:
    ...\Sample\VisualLISP\color-util.lsp

    Cheers
     
    Jürg Menzi, Jul 22, 2004
    #7
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.