i found this floating around here a while back. i use it regularly, but i was wondering if it is possible to change it so it will NOT zoom extents in modelspace in addition to zoom extents in all paperspace layouts?
if i remember correctly it was alan's code, but i'm not 100% on that, it was undocumented and i completely forgot to say who did it.
;zoom extents in all layouts
(defun c:zal (/ *acad* *doc* layouts ct lay)
(vl-load-com)
(setq *acad* (vlax-get-acad-object)
*doc* (vla-get-activedocument *acad*)
layouts (vla-get-layouts *doc*)
)
(setq ct (vla-get-activelayout *doc*))
(vlax-for lay layouts ; step through layouts
(vla-put-activelayout *doc* lay) ; activate layout
(if (= (vla-get-activespace *doc*) 0) ; If in paperspace
(if (= (vla-get-mspace *doc*) :vlax-true)
; in mspace viewport
(vla-put-mspace *doc* :vlax-false) ; inactivate vp
) ; endif
) ;endif
(vla-zoomextents *acad*)
)
(vla-put-activelayout *doc* ct)
)