hguo
in reply to: Anonymous

This same issue had been troubling us for long time, I finally figured out a way to work around. A lisp program is created to go through all the viewports except the ones in the current layout, and run the command "hideselectedinvp". Hope it helps.

 

(defun c:LISP67 (/ _ctab layst nt i ss vp)
(command "_.mspace")
(setq ss1 (ssget))
(setq _ctab (getvar 'CTAB))
(foreach x (layoutlist)
(setvar 'CTAB x)
(if (/= X "COVER SHEET")
(if (/= X "SPOOL LAYOUT")
(if (/= X "Spool_Template")
(if (/= X _ctab)
(if (setq ss (ssget "_X" (list '(0 . "VIEWPORT") '(-4 . "!=") '(69 . 1) (cons 410 x))))
(repeat (setq i (sslength ss))
(setq hnd (ssname ss (setq i (1- i)))
ent (entget hnd)
vp (cdr (assoc 69 ent))
)
(if (> vp 1)
(progn
(if (not (and (= 0 (getvar "tilemode")) (>= (getvar "cvport") 2)))
(command "_.mspace")
)
(setvar 'CVPORT vp)
(setq layst (strcat x ": VP " (itoa vp)))
(COMMAND "HIDESELECTEDINVP" ss1 "")
)
)
)
)
))))
)
(setvar 'CTAB _ctab)
(princ)
)