I'm wanting to modify LeeMac's code to change the same attributes in multiple layouts. My code below his is the only way I could come up with.
((410 . "02,03,04,05,06")) does not work, it wants a unique block name for each layout.
How do I modify LeeMac's code?
(defun LM:setattributevalue ( blk tag val / end enx )
(while
(and
(null end)
(setq blk (entnext blk))
(= "ATTRIB" (cdr (assoc 0 (setq enx (entget blk)))))
)
(if (= (strcase tag) (strcase (cdr (assoc 2 enx))))
(if (entmod (subst (cons 1 val) (assoc 1 (reverse enx)) enx))
(progn
(entupd blk)
(setq end val)
)
)
)
)
)
;;;my approach
(if (/= (getvar "ctab") "Model")
(progn
(LM:setattributevalue (ssname (ssget "X" '((410 . "02"))) 0) "PLANNO" "2113AL Standard")
(LM:setattributevalue (ssname (ssget "X" '((410 . "03"))) 0) "PLANNO" "2113AL Standard")
(LM:setattributevalue (ssname (ssget "X" '((410 . "04"))) 0) "PLANNO" "2113AL Standard")
(LM:setattributevalue (ssname (ssget "X" '((410 . "05"))) 0) "PLANNO" "2113AL Standard")
(LM:setattributevalue (ssname (ssget "X" '((410 . "06"))) 0) "PLANNO" "2113AL Standard")
(LM:setattributevalue (ssname (ssget "X" '((410 . "07"))) 0) "PLANNO" "2113AL Standard")
))
[code/]