This will make your Atts invisible:
Or, as a different functionality, this will make all tags with the listed name visible/invisible:Code:(defun c:invis (/ ent obj) (vl-load-com) (while (setq ent (car (nentsel "\nSelect Attribute: "))) (if (eq "ATTRIB" (cdr (assoc 0 (entget ent)))) (vlax-put (setq obj (vlax-ename->vla-object ent)) 'invisible -1))) (princ))
Upon Selection
All Blocks:Code:(defun c:am1 (/ tag ss att obj) (vl-load-com) (setq tag "TAG1") (while (setq ss (ssget "_+.:E:S" '((0 . "INSERT") (66 . 1)))) (foreach att (append (vlax-invoke (setq obj (vlax-ename->vla-object (ssname ss 0))) 'GetAttributes) (vlax-invoke obj 'GetConstantAttributes)) (if (eq tag (strcase (vla-get-TagString att))) (vlax-put att 'Invisible (~ (vlax-get att 'Invisible)))))) (princ))
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))) (vlax-put att 'Invisible (~ (vlax-get att 'Invisible)))))) (vla-delete sel)) (princ))




Reply With Quote


Bookmarks