We have a block contain 10 attibs to be seen with 8 differents scales making 80 attribs! (We use that before Annotative features). When we edit this block, we have a LISP that ask for the 10 avlues, and copy it for all the scale.
This lisp use the block ename in argument.
We start to use that block with MLEADER, but we can not edited with our lisp (can not find the ename of the block in the MLEADER definition ).
Is that a way to find this ename, and to be able to modify (our substitute) all the attributes value.
Here is an example of how you can do it. You supply it an associated list of tag names and new values. It will search the whole drawing for mleaders, and change the attributes that match, no matter the block name. So you might want to change it a little, but it will be a good starting point.
(defun UpdateMleaderAttributes ( attList / cnt ss Ent tempList ChangeAtt newEntData )
; Will update all mleaders whose attribute's tag matches those in the attList argument.
; Call like (UpdateMleaderAttributes '(("DETAIL" . "1")("SHEET" . "S-2.4")))
(setq cnt -1)
(if (setq ss (ssget "_x" '((0 . "MULTILEADER"))))
(while (setq Ent (ssname ss (setq cnt (1+ cnt))))
(foreach i (entget Ent)
(equal (type (cdr i)) 'ENAME)
(setq tempList (assoc (cdr (assoc 2 (entget (cdr i)))) attList))
(setq ChangeAtt T)
(equal (car i) 302)
(setq ChangeAtt nil)
(cons 302 (cdr tempList))
(entmod (reverse newEntData))
(setq newEntData nil)
What if I want to add a prompt?
I added this line;
(setq newval (getstring "\nEnter new Revision value:"))
Then tweaked your command like this;
(UpdateMleaderAttributes '(("REVNUM" . newval)))
I was not able to change the attribute in my multileader. Any ideas?
Thanks in advance.
It was to complex to use Mleader with Block and rewrite our lisp to control content of the attribs. So we decided to use ordinary Leader and associate them with our Block in a Unnamed Group.
This way our old lisp was able to control then content of the block.
I hope this suggestion helps
Access a broad range of knowledge to help get the most out of your products and services.