PDA

View Full Version : Set Attribute text color to Bylayer



ReachAndre
2007-01-30, 07:07 PM
Hey all,
It got WAY too cold this morning, it was at 30deg. (Thats unacceptable, Im in Florida for a reason!)

Problem:
Attribute color is set to green (or whatever color someone set it to).
I would like to find a way to change the attrib text property to "By Layer"

The only way I know how to do it now is through the 'enhanced Attribute Editor"

Is there a better way to do this? one that will work on all attributes in a selection set?

Thank you all,
Andre

T.Willey
2007-01-30, 07:44 PM
Yup.
Psuedo code
Get your selection set of blocks,
Then step through your selection set
Then step through your block entity
If the entity name is "SEQEND" you are done with that block,
if it equals "ATTRIB" then you want to change the color dxf code to 256.

ReachAndre
2007-01-30, 09:11 PM
not quite sure I understand what you mean "Step through" and the idea is to change many blocks at once, this last project, we changed 100 plus attributes

T.Willey
2007-01-30, 10:10 PM
(defun c:Test ()

(setq cnt -1)
(if (setq ss (ssget '((0 . "INSERT") (66 . 1))))
(while (setq ent (ssname ss (setq cnt (1+ cnt))))
(while (= (cdr (assoc 0 (setq entdata (entget (setq ent (entnext ent)))))) "ATTRIB")
(if (assoc 62 entdata)
(entmod (subst (cons 62 256) (assoc 62 entdata) entdata))
)
)
)
)
(princ)
)


Fix code per Kennets comments. Thanks Kennet.

kennet.sjoberg
2007-01-30, 10:49 PM
oops . . typo in line (while (= (cdr (assoc 0 (setq . . .


: ) Happy Computing !

kennet