There are times when sending or submitting drawings to client or another drafter when the blocks in your drawings contain many attributes – some of which may be set to Invisible. And if you have ever wanted to delete invisible attributes, this routine is for you.
Warning: this does not work when trying to delete ALL attributes even if they are all set to invisible. At least one attribute has to be set to visible for this routine to work.
In case you are wondering how to set Attribute Visibility:
When creating an attribute you can toggle the visibility (as seen below)
Or when using the BATTMAN command you can edit which attributes are visible or invisible (seen below)
Another LISP routine [found here] allows you to select different instances of a block and toggle the visibility. Note: the DIA.lsp routine uses the command ATTSYNC which will synchronize all instances of a block based on the one you select.
Here’s how:
- DIA <enter> to start
- Type in the name of the block <enter>
that’s it
;;; By Lee-Mac http://www.theswamp.org/index.php?topic=36280.0 (defun delInvisAtts ( bname ) (vl-load-com) (if (tblsearch "BLOCK" bname) (vlax-for obj (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)) ) bname ) (if (and (eq (vla-get-objectname obj) "AcDbAttributeDefinition") (eq (vla-get-invisible obj) :vlax-true) ) (vla-delete obj) ) ) ) ) (defun c:DIA ( / bn ) (delInvisAtts (setq bn (getstring t "\nBlock Name: "))) (vl-cmdf "_.attsync" "_N" bn) (princ) )
I know this is a very old post, but I wanted to let everyone know that the code posted by at The SWAMP by Lee Mac in reply #4 is different than the code posted above and, in my testing, it worked on all invisible attributes even when all the attributes in the block are invisible. I don’t know when it may have changed, or why it’s different, but it seems to work flawlessly.