Easier way:
Code:(defun c:am2 (/ tag ss sel) (vl-load-com) (setq tag "TAG1") ;; <<-- Tag to be Searched (and (setq ss (ssget "_X" '((0 . "INSERT") (66 . 1)))) (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object)))) (foreach att (append (vlax-invoke Obj 'GetAttributes) (vlax-invoke Obj 'GetConstantAttributes)) (if (eq tag (strcase (vla-get-TagString att))) (vla-put-invisible att (cond ((eq :vlax-true (vla-get-invisible att)) :vlax-false) (:vlax-true)))))) (vla-delete sel)) (princ))




Reply With Quote


Bookmarks