BIGAL Posted June 21, 2011 Posted June 21, 2011 Once you have multiple layout tabs its very easy to zoom in on a tab make some changes jump to another tab zoom in make some more changes, then save the dwg. You then open the drawing to say plot and have to zoom e the layout as a glance to see if its correct etc So I wrote this tiny lisp that will very quickly zoom extents on all layout tabs and then I would normally save, so I hope its usefull to others. ; goes through all layout tabs and zooms all ; By Alan H june 2011 (vl-load-com) (command "_.pspace") (setq curtab (getvar "Ctab")) (setq this_dwg (vlax-get-acad-object)) (foreach d (layoutlist) (setvar "CTAB" d) (vla-ZoomExtents this_dwg) ) (setvar "ctab" curtab) (princ) Quote
Murph_map Posted June 21, 2011 Posted June 21, 2011 You know I just noticed your name as AL and your users name here is BigAl not BiGal. NTTATWWT Quote
alanjt Posted June 21, 2011 Posted June 21, 2011 A very useful routine. I wrote one a while back and we use it religiously. Be sure to make sure each layout is in paperspace (not model) before you zoom extents. Here's mine: (defun c:ZAL (/) ;; Zoom extents in All Layouts (excluding Model) ;; Alan J. Thompson (or *Acad* (setq *Acad* (vlax-get-acad-object))) (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument *Acad*))) ((lambda (ctab) (foreach layout (layoutlist) (setvar 'ctab layout) (vla-put-mspace *AcadDoc* :vlax-false) (vla-zoomextents *Acad*) ) (setvar 'ctab ctab) ) (getvar 'ctab) ) (princ) ) Quote
BIGAL Posted June 22, 2011 Author Posted June 22, 2011 Thanks Alan worked out the first one needed but didn't consider other layouts Quote
Baber62 Posted May 20, 2016 Posted May 20, 2016 How do I modify this routine to zoom to 95% on all the layouts? Quote
BIGAL Posted May 21, 2016 Author Posted May 21, 2016 Zoom 0.95X chuck it in at correct point. Have a go. Quote
Baber62 Posted March 8, 2017 Posted March 8, 2017 Hi BIGAL, Tried it ... failed miserably ... can you let me know where I'm going wrong (defun c:ZAL (/) ;; Zoom extents in All Layouts (excluding Model) ;; Alan J. Thompson (or *Acad* (setq *Acad* (vlax-get-acad-object))) (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument *Acad*))) ((lambda (ctab) (foreach layout (layoutlist) (setvar 'ctab layout) (vla-put-mspace *AcadDoc* :vlax-false) (vla-zoomextents *Acad*) [color="red"];following line added (vla-zoom0.95x *Acad*)[/color] ) (setvar 'ctab ctab) ) (getvar 'ctab) ) (princ) ) Quote
BIGAL Posted March 9, 2017 Author Posted March 9, 2017 1st No Function Vla-zoom and 2nd if it worked (vla-zoom0.95 equates to a defun by that name seperating space is missing. Quote
Baber62 Posted March 10, 2017 Posted March 10, 2017 Thanks Cad64 that did the trick. Thank's BIGAL, appreciated. I tried the following line of code and this also worked (command "_.zoom" "_s" "0.95x") Quote
MillerMG Posted March 10, 2017 Posted March 10, 2017 (edited) Once you have multiple layout tabs its very easy to zoom in on a tab make some changes jump to another tab zoom in make some more changes, then save the dwg. You then open the drawing to say plot and have to zoom e the layout as a glance to see if its correct etc So I wrote this tiny lisp that will very quickly zoom extents on all layout tabs and then I would normally save, so I hope its usefull to others. ; goes through all layout tabs and zooms all ; By Alan H june 2011 (vl-load-com) (command "_.pspace") * Once I loaded the app it ran it. How can I run the command without going to app load? Thanks again. (setq curtab (getvar "Ctab")) (setq this_dwg (vlax-get-acad-object)) (foreach d (layoutlist) (setvar "CTAB" d) (vla-ZoomExtents this_dwg) ) (setvar "ctab" curtab) (princ) Hey BigAl. Dumb question. How do I start the lisp after I load it? I know that most use some type of letters to call up the command. I hate that I don't know how to do this, but would love to know how to. As always, thanks for any and every comment. Edited March 10, 2017 by MillerMG It worked 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.