How can I make the active viewport the actual page I am on? In other words if I use mview and create 3 viewports there are now 4 viewports. Can I make the 4th one the active viewport?
What I am trying to do is to turn off all of the viewports because a lisp routine that runs is regening multiple times in every viewport and I would like to be able to do all of my stuff and then do 1 regenall for all viewports.
The "4th" viewport is the PaperSpace viewport and will always (at least in my somewhat limited checking) be the first one found. If you get a list of the viewport(s), ala the code I posted earlier today to another thread, you could make each one inactive quite easily.
(defun test (/ *ACTIVELAYOUT* CSCALE LAYOUTBLK LAYVP)
(setq *activelayout* (vla-get-activelayout
(vla-get-activedocument
(vlax-get-acad-object))
))
(setq layoutblk (vla-get-block *activelayout*))
(vlax-for item layoutblk
(if (= (vla-get-objectname item) "AcDbViewport")
(setq layvp (cons item layvp))
)
)
(setq layvp (cdr (reverse layvp))); remove the PS view object (if layvp (progn (foreach x layvp (vla-display x :vlax-false);turn off vports ) ;;do your other stuff here.... (foreach x layvp (vla-display x :vlax-true);turn 'em back on ) ) )
)
Jeff
tsigwing said:
How can I make the active viewport the actual page I am on? In other