(setq Sel (nentsel "\n Select attribute entity: "))
(setq EntData (entget (car Sel)))
(setq EntData (subst (cons 370 -1) (assoc 370 EntData) EntData))
(entmod EntData)
(entupd (cdr (assoc -1 EntData)))
The above worked for me, but I noticed that once it was changed to '-1' the
dxf code isn't there anymore, so you would have to use the 'append' function
to add it. That may be your problem.
--
Tim
"A blind man lets nothing block his vision."
wrote in message news:5414400@discussion.autodesk.com...
I am trying to modify attribute's lineweight with hard coded colors based on
an existing CTB. I am creating a selection set and processing only those
attributes with code 62 present. I having trouble getting code 370 for the
attributes. This code (setq eLwt (cdr (assoc 370 eList)) returns nil and the
entmod don't do anything. I know code 370 will return -1 for ByLayer, -2 for
ByBlock and -3 for Default. What I am doing wrong? Is the 370 code
accessible through Autolisp or do I need to use Vlisp to access it?. Any
help will be appreciated. Here is part of the code:
(defun C:ChgAttLW (/ ss sslen ct blk ent eList)
(setq ss (ssget "x" '((0 . "INSERT")))
ct 0
sslen (sslength ss)
)
(while (< ct sslen)
(setq blk (ssname ss ct)
ent (entnext blk)
eList (entget ent)
)
(while (and ent (= (cdr (assoc 0 eList)) "ATTRIB"))
(if (assoc 62 eList)
(progn
(setq eClr (cdr (assoc 62 eList))
eLwt (cdr (assoc 370 eList))
)
(GetClrLW)
(setq eList (entmod (subst (cons 370 LinW) (cons 370 eLwt) eList)))
)
)
(entupd ent)
(setq ent (entnext ent))
(setq eList (entget ent))
)
(setq ct (1+ ct))
)
(princ)
)
Alex