@andrea_ricci-ext wrote:
Is there any autolisp to copy the color to clipboard?
Ideally I wish: if bylayer→ layer's color, otherwise the object's color, acad code or RGB. ....
Getting it is not hard:
(defun C:eColor (/ ent)
(setq
ent (car (entsel "\nObject to get its color: "))
eColor (getpropertyvalue ent "color")
eColor
(if (member eColor '(0 256))
(cdr (assoc 62 (tblsearch "layer" (cdr (assoc 8 (entget ent))))))
eColor
)
)
)
That results in a text string if it's a Truecolor object override, or an integer if it's an index color, and it seems if it's ByLayer/ByBlock and the Layer's color is Truecolor [it gets "rounded" to the closest index color]. I'm not sure how to get the Truecolor numbers of the Layer color, which are similarly "rounded" in (tblsearch) and (entget (tblobjname)) results. But they must be available -- the Layer Manager list shows them.
Getting it to the clipboard is a little more complicated, but I agree -- how are you going to use the information? That could affect what should be done with it.
Kent Cooper, AIA