Originally Posted by
mikehaff
....I have several blocks in a drawing that are invisible in unpurgeable. .
I guess what you meant by invisible is "not seen" on drawing screen and not "invisible mode" attribute definition.
Originally Posted by
mikehaff
...but I'm stumped on how to create a selection set of blocks that contain only attributes and those attributes are all null.
So the condition is IF and ONLY IF the block is all Attribute and the inserted block is "invisible" [meaning attributes with null value]
Try this
Code:
(defun c:Aab (/ blocks ss bnlsy e att bn) ;<--- Attribute And Blank
(setq Blocks (vla-get-blocks
(vla-get-ActiveDocument (vlax-get-acad-object))
)
)
(if (setq bnlst nil
ss (ssget "_X" '((0 . "INSERT") (66 . 1)))
)
(repeat (setq i (sslength ss))
(setq e (vlax-ename->vla-object (ssname ss (setq i (1- i))))
att (vlax-invoke e 'Getattributes)
)
(and (cond
((member (setq bn (vla-get-effectivename e)) bnlst))
((= (vla-get-count
(vla-item blocks
(setq bn (vla-get-effectivename e))
)
)
(length att)
)
(setq bnlst (Cons bn bnlst))
)
)
(vl-every '(lambda (a)
(eq (vla-get-textstring a) "")
)
att
)
(vla-delete e)
)
)
)
(princ)
)
(vl-load-com)
Originally Posted by
dgorsman
FYI: don't forget to check inside other block definitions. These types of blocks get *everywhere* from inserting drawings into blank drawings,
I guess we can incorporate that option on the routine as well.