I wrote a script that could zoom all layouts in drawing. But it doesnt work... could anybody help me please? 🙂 I am really courious where I made a mistake...
(defun C:zoomall (/ layouts num) (setq layouts (layoutlist)); list all paperspace layouts in the drawing (setq num 0); zero counter (repeat (length layouts); Repeats the plot command on all layouts (command "_.zoom" "_a" ;; Specify corner of window, enter a scale factor (nX or nXP), or [All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>:_e );; end _.zoom (setq num (1+ num)); Increment counter ); end repeat ); end function
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@Anonymous wrote:I wrote a script that could zoom all layouts in drawing. But it doesnt work... could anybody help me please? 🙂 I am really courious where I made a mistake...
(defun C:zoomall (/ layouts num) (setq layouts (layoutlist)); list all paperspace layouts in the drawing (setq num 0); zero counter (repeat (length layouts); Repeats the plot command on all layouts (command "_.zoom" "_a" ;; Specify corner of window, enter a scale factor (nX or nXP), or [All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>:_e );; end _.zoom (setq num (1+ num)); Increment counter ); end repeat ); end function
You need to get into each Layout before Zooming in it. [The way you have it, it just Zooms All as many times as there are Layouts, but always in whatever space you happen to start in.] One way is as done in the attached, though that contains commands for Zooming to the Limits or to the Extents, one or the other of which may give different results than Zoom All, depending on the relationship between drawn content and the Limits. You could add a ZAAL command to do a Zoom All in each, if you like.
@Anonymous wrote:Thank you! It is very helpfull.
You're welcome. I added a command to Zoom All in All Layouts [ZAAL] to the updated attached version.