Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Block in MLEADER
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello,
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.
Stephane
Responsable - traitement de l'information (gestion des espaces)
Service de la planification et des projets immobiliers
HEC Montréal
www.hec.ca
Re: Block in MLEADER
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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)
(if
(and
(equal (type (cdr i)) 'ENAME)
(setq tempList (assoc (cdr (assoc 2 (entget (cdr i)))) attList))
)
(setq ChangeAtt T)
)
(setq newEntData
(cons
(if
(and
ChangeAtt
(equal (car i) 302)
)
(progn
(setq ChangeAtt nil)
(cons 302 (cdr tempList))
)
i
)
newEntData
)
)
)
(entmod (reverse newEntData))
(setq newEntData nil)
)
)
(princ)
)
Re: Block in MLEADER
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.
Re: Block in MLEADER
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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
Stephane
Responsable - traitement de l'information (gestion des espaces)
Service de la planification et des projets immobiliers
HEC Montréal
www.hec.ca
