- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The program below works great to modify ALL blocks in model space to the defined visibility state. I would like to modify it to change only selected blocks.
(defun c:changevis ( / blk idx obj sel vis ) ;;;<<< CHANGES VISIBILITY STATE OF ALL BLOCKS IN MODEL SPACE
(setq blk "SCHEM-SPA-RTN" ;; Block Name
vis "90" ;; New Visibility State
)
(if (setq sel (ssget "_X" (list '(0 . "INSERT") (cons 2 (strcat "`*U*," blk)))))
(repeat (setq idx (sslength sel))
(if (= (strcase blk) (strcase (LM:blockname (setq obj (vlax-ename->vla-object (ssname sel (setq idx (1- idx))))))))
(LM:SetVisibilityState obj vis)
)
)
)
(princ)
)
I tried a few ways of using this but nothing worked out (this is a program I use to change the Block Table selection, I thought it would work for Visibility state also but no):
(defun C:TEST ( / ss )
(if (setq ss (ssget '((0 . "INSERT"))))
(while (setq e (ssname ss 0))
(setpropertyvalue e
"AcDbDynBlockPropertyVisibility 1" 90)
(ssdel e ss)
)
)(princ)
)
Solved! Go to Solution.