Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ZOOM ALL using code

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
664 Views, 3 Replies

ZOOM ALL using code

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

 

3 REPLIES 3
Message 2 of 4
Kent1Cooper
in reply to: Anonymous


@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.

Kent Cooper, AIA
Message 3 of 4
Anonymous
in reply to: Kent1Cooper

Thank you! It is very helpfull. 

Message 4 of 4
Kent1Cooper
in reply to: Anonymous


@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.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost