Hi,
using autolisp or visual lisp I want to open "Select Color Dialog Box" http://exchange.autodesk.com/autocadarchitecture/enu/online-help/browse#WS1a9193826455f5ffa23ce210c4... and get RGB color code to my lisp.
If I enter "color" in command line, i get color dialog box, but if I use this command in (command "color") I get more promts and not color Dialog Box.
I want to make a lisp routine which would ask for first color, second color and range of colors. And will calculate color range from first color to second color.
Thanks.
Solved! Go to Solution.
Solved by _Tharwat. Go to Solution.
Solved by hmsilva. Go to Solution.
Thanks,
it is just what was necessary.
But I do not understand true color code returned from acad_truecolordlg. This one (420 . 7022356). It should be (“Red,Green,Blue”), but is some big number. How can I convert it to red,green,blue?
7022356 is color 107,39,20 in select color box.
Result:
(defun MakeColorRange (firstColor secondColor colorRange / rangeRed rangeGreen rangeBlue result) (setq rangeRed (fix (/ (- (car firstColor) (car secondColor)) colorRange))) (setq rangeGreen (fix (/ (- (cadr firstColor) (cadr secondColor)) colorRange))) (setq rangeBlue (fix (/ (- (caddr firstColor) (caddr secondColor)) colorRange))) (setq result (cons firstColor (setq result (list)))) (repeat colorRange (setq firstColor (list (- (car firstColor) rangeRed) (- (cadr firstColor) rangeGreen) (- (caddr firstColor) rangeBlue))) (setq result (cons firstColor result)) ) (reverse result) ) (defun C:ColorScheme ( / firstColor secondColor colorRange) (setq firstColor (TrueColor-split (cdr (assoc 420 (acad_truecolordlg '(420 . 2686760) nil))))) (setq secondColor (TrueColor-split (cdr (assoc 420 (acad_truecolordlg '(420 . 2686760) nil))))) (setq colorRange (- (getint "\n Enter color range number: ") 1)) (princ (MakeColorRange firstColor secondColor colorRange)) (princ) )