madcadder
2007-03-05, 06:53 PM
Can someone show me how to get a list of and cycle all open drawings running this code on each drawing?
(DEFUN zoom_all_layouts (/ lay layouts *acad* *doc*)
(VL-LOAD-COM)
(SETQ *acad* (VLAX-GET-ACAD-OBJECT)
*doc* (VLA-GET-ACTIVEDOCUMENT *acad*)
layouts (VLA-GET-LAYOUTS *doc*)
) ;_ end of setq
(REPEAT 3
(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*)
) ;_ end of vlax-for
) ;_ end of repeat
) ;_ end of defun
(DEFUN zoom_all_layouts (/ lay layouts *acad* *doc*)
(VL-LOAD-COM)
(SETQ *acad* (VLAX-GET-ACAD-OBJECT)
*doc* (VLA-GET-ACTIVEDOCUMENT *acad*)
layouts (VLA-GET-LAYOUTS *doc*)
) ;_ end of setq
(REPEAT 3
(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*)
) ;_ end of vlax-for
) ;_ end of repeat
) ;_ end of defun