
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello. always thank you everyone
this lsp is get the color number from selected object.
I want I get the color number of the selected block inside block object ?
(defun C:CN (/ esel obj col laycol msg)
(if (setq esel (entsel "\nSelect object to report its Layer's color:"))
(progn
(setq
obj (vlax-ename->vla-object (car esel))
col (vla-get-color obj)
laycol (cdr (assoc 62 (tblsearch "layer" (vla-get-layer obj))))
); setq
(alert
(setq msg
(strcat
"Color of object's Layer is " (itoa laycol) "."
(if (/= col 256); only if not ByLayer
(strcat
"\nObject has override color "
(if (= col 0) "ByBlock" (itoa col))
"."
); strcat
"" ; [add nothing to msg if ByLayer]
); if
); strcat & msg
); setq
); alert
(prompt (strcat "\n" msg))
); progn
); if
(princ)
); defun
Solved! Go to Solution.