Author Topic: Choose a color  (Read 2057 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 350
Choose a color
« on: January 26, 2006, 03:26:32 PM »
As part of another lisp I am working on I wanted to utilize the command "color" which brings up the select color dialog. Any reason this does not "pop up" when run in the following code?

Code: [Select]
(defun c:coloring (/ oldecho oldcolor newcolor)
 (setq oldecho (getvar "cmdecho"))
 (setvar "cmdecho" 1)
 (setq oldcolor (getvar "cecolor"))
 (command ".color" pause)
 (setq newcolor (getvar "cecolor"))
 (prompt (strcat "\nThe OLD color was <" oldcolor "> and the NEW color is <" newcolor ">"))
 (setvar "cmdecho" oldecho)
 (princ)
)

Thanks,
Dan

T.Willey

  • Needs a day job
  • Posts: 5241
Re: Choose a color
« Reply #1 on: January 26, 2006, 03:32:48 PM »
Try this.
Code: [Select]
(setq xclr (acad_colordlg 252))
The 252 at the end is the default value I wanted, you can change it if you like.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

DanB

  • Bull Frog
  • Posts: 350
Re: Choose a color
« Reply #2 on: January 26, 2006, 04:24:25 PM »
Thanks, I think that will work, going to need to try it out though...

CADmium

  • Newt
  • Posts: 33
Re: Choose a color
« Reply #3 on: January 27, 2006, 02:40:04 AM »
look here .. scroll down to  "Adding the ability to select True Colors to your LISP programs"
"Bei 99% aller Probleme ist die umfassende Beschreibung des Problems bereits mehr als die Hälfte der Lösung desselben."

CAB

  • Global Moderator
  • Seagull
  • Posts: 10388
Re: Choose a color
« Reply #4 on: January 27, 2006, 09:39:52 AM »
Welcome to the Swamp Lee.

Nice web site, thanks. :-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.