Here is another way that will do it.
(if (setq ss (ssget "x" '((0 . "INSERT") (66 . 1))))
(progn
(setq i 0)
(repeat (sslength ss)
(setq ename (ssname ss i))
(if (setq lst (nEnts ename "ATTRIB"))
(foreach item lst
(vla-put-color (vlax-ename->vla-object item) 256)
)
)
(setq i (1+ i))
)
)
)
; Jason Piercey . June 2nd, 2003
; get list of sub entity names
; [ename] - entity name or vla-object - block, insert or polyline
; [filter] - string, re: wcmatch()
; return: list of enames or nil
; revised: July 10th, 2003 - accepts ename or vla-object
(defun nEnts (ename filter / data ent rtn)
(or (= 'ename (type ename))
(setq ename (vlax-vla-object->ename ename)) )
(setq filter (strcase filter))
(while (and ename (setq ename (entnext ename)))
(setq data (entget ename))
(setq ent (cdr (assoc 0 data)))
(if (wcmatch ent filter)
(setq rtn (cons ename rtn)) )
(if (= "SEQEND" ent) (setq ename nil))
)
(reverse rtn)
)
--
Autodesk Discussion Group Facilitator
wrote in message news:4835016@discussion.autodesk.com...
I have about 500 blocks in my drawing that were inserted. For some reason,
the block was defined with an attribute set to a color...I want the
attribute set to "bylayer". It is annoying to go thru the drawing using
EATTEDIT picking each block, so I tried to write a lisp routine to automate
it.