I'm putting together a script that draws a line, and writes out the layer name, description, color, & lineweight for every layer in a drawing. It works great. But I want it to also give me the rgb color value. It's easy enough grab the info, but I can't seem to print it...
I can get color (indexed) and truecolor (RGB):
(setq layc (vla-get-Color lay))
(setq laytc (vla-get-TrueColor lay))
And I can write out indexed color:
(command "text" "j" "ml" (list dx5 dyy) "0.09375" "0" layc)
"5"
But TrueColor is confounding me... the closest I get is:
(command "text" "j" "ml" (list dx6 dyy) "0.09375" "0" (vl-princ-to-string laytc)) ;;; works, bad form
"#<VLA-OBJECT IAcadAcCmColor 0000000072c40f90>"
I also tried this, which chokes on layer one and stops the script:
(command "text" "j" "ml" (list dx5 dyy) "0.09375" "0" laytc) ;;; does not work
"Enter text: ; error: bad argument value: AutoCAD command: #<VLA-OBJECT IAcadAcCmColor 0000000072ab2ca0>"
Does anyone know what form true color is in and how to convert ir to a "r,g,b" string?