Pither Rukka Posted October 2, 2012 Posted October 2, 2012 Hi, I usually drawing some layout in one file. when review, after zooming on a layout I forgot to zoom extend before move to others layout. Problem when save and close the file I need many time to zoom extend all layouts. Could somebady help me a routine for zoom extend all layout. Many Thank. Pither Rukka Quote
asos2000 Posted October 2, 2012 Posted October 2, 2012 ;Zom Extends all layouts (defun c:LZE (/ Ctab Layout) (princ "\nLayouts Zoom Extents") (setq Ctab (getvar "CTAB")) (foreach Layout (layoutlist) (command "LAYOUT" "S" Layout) (command "PSPACE") (command "ZOOM" "E") ) (setvar "CTAB" Ctab) (princ) ) ;Zoom window all layouts (defun c:LZW (/ Ctab Layout P1 P2) (princ "\nLayouts Zoom Window") (if (/= (setq Ctab (getvar "CTAB")) "Model") (progn (command "PSPACE") (if (setq P1 (getpoint "\nSpecify first corner: ")) (setq P2 (getcorner P1 "Specify opposite corner: ")) ) (if (and P1 P2) (foreach Layout (layoutlist) (command "LAYOUT" "S" Layout) (command "PSPACE") (command "ZOOM" "W" P1 P2) ) ) ) (command "ZOOM" "W") ) (setvar "CTAB" Ctab) (princ) ) Quote
nod684 Posted October 2, 2012 Posted October 2, 2012 ;Zom Extends all layouts (defun c:LZE (/ Ctab Layout) (princ "\nLayouts Zoom Extents") (setq Ctab (getvar "CTAB")) (foreach Layout (layoutlist) (command "LAYOUT" "S" Layout) (command "PSPACE") (command "ZOOM" "E") ) (setvar "CTAB" Ctab) (princ) ) ;Zoom window all layouts (defun c:LZW (/ Ctab Layout P1 P2) (princ "\nLayouts Zoom Window") (if (/= (setq Ctab (getvar "CTAB")) "Model") (progn (command "PSPACE") (if (setq P1 (getpoint "\nSpecify first corner: ")) (setq P2 (getcorner P1 "Specify opposite corner: ")) ) (if (and P1 P2) (foreach Layout (layoutlist) (command "LAYOUT" "S" Layout) (command "PSPACE") (command "ZOOM" "W" P1 P2) ) ) ) (command "ZOOM" "W") ) (setvar "CTAB" Ctab) (princ) ) will these unlock the viewports if its lock? Quote
MSasu Posted October 2, 2012 Posted October 2, 2012 The zooming operations from above routines are performed at layout sheets level, so doesn't affect the scale of viewports contained in those. Quote
nod684 Posted October 2, 2012 Posted October 2, 2012 The zooming operations from above routines are performed at layout sheets level, so doesn't affect the scale of viewports contained in those. got it! i thought its inside the viewport tested and working! should be useful routine! thanks a lot! Quote
Lee Mac Posted October 2, 2012 Posted October 2, 2012 Another version: ;; Zoom Extents all Layouts - Lee Mac (defun c:zea ( / app ctb doc ) (setq app (vlax-get-acad-object) doc (vla-get-activedocument app) ctb (getvar 'ctab) ) (foreach tab (layoutlist) (setvar 'ctab tab) (vla-put-mspace doc :vlax-false) (vla-zoomextents app) ) (setvar 'ctab ctb) (princ) ) (vl-load-com) (princ) 1 Quote
Biscuits Posted November 25, 2013 Posted November 25, 2013 Here's one I incorpoate with my save button ; Zoom All - In all layouts with one command (defun c:ZoomLayouts ( / ctab) (setq ctab (getvar "ctab")) (foreach tab (cons "Model" (layoutlist)) (setvar 'CTAB tab) (command "zoom" "e" "limits" "off") ) (setvar "ctab" ctab) (princ) Quote
Baber62 Posted March 7, 2017 Posted March 7, 2017 Hi Lee, would it be possible to adjust routine so that it asked the user what zoom is required? Quote
Lee Mac Posted March 7, 2017 Posted March 7, 2017 Hi Lee, would it be possible to adjust routine so that it asked the user what zoom is required? In what way? Choosing between Extents/Center/All? Quote
Baber62 Posted March 7, 2017 Posted March 7, 2017 Between extents, and different percentage of zooms for example have the lowest percentage as 50%, then 75%, then 95% and finally extents. I have adapted the above routine but had to do it three additional times and labelled them as ZEA50, ZEA75, ZEA95 and ZEA. Another modification would be to have it ask whether to apply to current layout only or all layouts. Before I close and save the file I run the ZEA75 routine which zooms all the layouts in the current drawing to 75% of the space shown on the screen. Then I save and close the file ready for the next working day. Quote
BIGAL Posted March 8, 2017 Posted March 8, 2017 baber62 just use the window version posted above is it critical to be 75% or 72 or 77 as picked is ok. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.