Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How can I delet all the non display attribute in a dynamic block using LISP or other script.
Solved! Go to Solution.
How can I delet all the non display attribute in a dynamic block using LISP or other script.
Solved! Go to Solution.
check this one. deletes all invisible attributes in a selected dynamic block.
(defun c:delete_invisible_atts (/ dyn_block count)
(setq count 0)
(vla-startundomark (vla-get-activedocument (vlax-get-acad-object)))
(setq dyn_block (vlax-ename->vla-object (car (entsel "\nSelect dynamic block with invisible attributes: "))))
(if (minusp (vlax-get dyn_block 'isdynamicblock))
(vlax-map-collection (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (vla-get-effectivename dyn_block))
'(lambda (object)
(and (= "AcDbAttributeDefinition" (vla-get-objectname object))
(or (minusp (vlax-get object 'invisible))
(zerop (vlax-get object 'visible))
)
(null (vla-erase object))
(setq count (1+ count))
(command "_attsync" "_n" (vla-get-effectivename dyn_block))
)
)
)
)
(princ (strcat "\n" (itoa count) " deleted"))
(vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
(princ)
)
Thanks. Is this going also to delete visible attribute that are not display on the drawing because visabiliy state. I need to delete those attribut too.
modified to delete both.
I don't see the modified script. The first one delete all invisble attribute but leaves the visibel one that not display (because of visbility state) intake.
it is in message 2.
Thank you Its working perfect.