Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

LISP - Running through every sheet and zooming out 3

Status
Not open for further replies.

JuanBC

Electrical
Nov 28, 2017
141
Hi,

Does anyone have a LISP routine that runs through every layout of a drawing? I would like to adapt it to a lisp that automatically 'zooms out' every sheet in a .dwg

Thanks!

JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
 
Replies continue below

Recommended for you

Not quite what you're asking for but it's what I do...

Add this single line to your ACAD.LSP file:

[ul][li](defun c:ZE () (command "zoom" "e"))[/li][/ul]

then:
[ul][li]start in model space[/li]
[li]<CRTL>-<PgDn>[/li]
[li]ZE[/li]
[li]<CRTL>-<PgDn>[/li]
[li]<ENTER>[/li]
[li](repeat for as many sheets as the drawing has)[/li][/ul]

Since your right hand can quickly type "CRTL-PgDn" and your left hand can hit ENTER this should take about 1/2 second per sheet.

If your drawings have LOTS of sheets, then additional automation is called for, of course.

Considering some alternatives: do you use named views? Do your drawings always have the same number of sheets? If every sheet has a named view, and you were prepared to preset the named views in the template, and the template can have all of the necessary sheets already created, then you could have this set up in advance. Then a single LISP command could be used to re-size all sheet views per the named views. Takes a lot of pre-configuration, as you can see.

STF
 
Hi STF,

I am also used to doing the same thing but sometime I work with drawings with multiple layouts and i'ts quite annoying

After posting this thread I found this code. Hope it helps you

Code:
;; 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)





JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
 
I like this, thanks!

I use ZE also but after it is done I zoom to 0.98x to add a little border
(DEFUN C:ZE () (COMMAND "ZOOM" "E" "ZOOM" ".98X") (PRINC)) ; Zoom E then .98X
Also ZP
(DEFUN C:ZP () (COMMAND "ZOOM" "P") (PRINC)) ; Zoom P
also Z9
(DEFUN C:Z9 () (COMMAND "ZOOM" ".95X") (PRINC)) ; Zoom .95x
and for moving around in and out reviewing drawings
(DEFUN C:ZD () (COMMAND "ZOOM" "D") (PRINC)) ; Zoom dynamic
 
Hi!

I'm glad you like it, and thanks for the improvement! I'm going to use it

Regards,

JBC
.......
"The more I read, the more I acquire, the more certain I am that I know nothing"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor