You can use the following vlisp codes instead:
Functions:
MT:Vanish - to hide objects in selection set:
MT:Unvanish - to unhide objects in selection set:Code:(defun MT:Vanish (%ss% / n ent) ;; by Mehrdad Ahankhah (Mehre Taban) (if (and (= 'PICKSET (type %ss%)) (< 0 (setq n (sslength %ss%)))) (progn (princ (strcat "\nGoing to vanish " (itoa n) " objects.")) (while (> n 0) (setq n (1- n)) (setq ent (entget (ssname %ss% n))) (if (assoc 60 ent) (setq ent (subst '(60 . 1) (assoc 60 ent) ent)) (setq ent (append ent '((60 . 1)))) ) (entmod ent) ) (princ "\n'Vanish' done successfully.") ) (T (princ "Nothing to vanish.")) ) (princ) )
Commands:Code:(defun MT:Unvanish (%ss% / n ent) ;; by Mehrdad Ahankhah (Mehre Taban) (if (and (= 'PICKSET (type %ss%)) (< 0 (setq n (sslength %ss%)))) (progn (princ (strcat "\nGoing to set visible " (itoa n) " objects.")) (while (> n 0) (setq n (1- n)) (setq ent (entget (ssname %ss% n))) (setq ent (subst '(60 . 0) (assoc 60 ent) ent)) (entmod ent) ) (princ "\n'Unvanish' done successfully.") ) (progn (alert "Nothing to set visible.")) ) (princ) )
Vanish or Off - to hide all objects
VanishSelected or OffSelected - to hide objects in a selection set and save the selection set with given nameCode:(defun C:Vanish () (MT:Vanish (ssget))) (defun C:Off () (C:Vanish))
Unvanish or On - to unhide all objectsCode:(defun C:VanishSelected (/ name ss) (setq name (getstring "\nEnter the name of the selection set: ")) (setq ss (ssget)) (set (read (strcat "MehreTaban-" name)) ss) (MT:Vanish ss) ) (defun C:OffSelected () (C:VanishSelected))
UnvanishSelected or OnSelected - to unhide objects in a previously saved selection setCode:(defun C:Unvanish () (MT:Unvanish (ssget "x" '((60 . 1))))) (defun C:On () (C:Unvanish))
Code:(defun C:UnvanishSelected () (MT:Unvanish (eval (read (strcat "MehreTaban-" (getstring "\nEnter the name of selection set: "))))) ) (defun C:OnSelected () (C:UnvanishSelected))




Reply With Quote

Bookmarks