Author Topic: Zoom extent on a close document  (Read 1695 times)

0 Members and 1 Guest are viewing this topic.

latour_g

  • Newt
  • Posts: 184
Zoom extent on a close document
« on: August 07, 2018, 04:08:10 PM »
Hi,
I would like to know if it's possible to make a zoom extent on all layout of a close document ?
Or it's only possible if the drawing is open ?

Thank you

BIGAL

  • Swamp Rat
  • Posts: 1411
  • 40 + years of using Autocad
Re: Zoom extent on a close document
« Reply #1 on: August 09, 2018, 11:23:08 PM »
You can redefine "CLOSE" so it runs a lisp as part of the close say zoom all layouts then close. Search redefine.

Simplest way is to write your own lisp and use it instead of close, last line in lisp executes Close.
A man who never made a mistake never made anything

latour_g

  • Newt
  • Posts: 184
Re: Zoom extent on a close document
« Reply #2 on: August 16, 2018, 03:21:39 PM »
ok thanks I will check that !

BIGAL

  • Swamp Rat
  • Posts: 1411
  • 40 + years of using Autocad
Re: Zoom extent on a close document
« Reply #3 on: August 17, 2018, 04:31:58 AM »
This is one example

Code: [Select]
; goes trhough 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)
  (COMMAND "pSPACE")
  (command "zoom" "C" "400,277" 750) ; in case junk around title block
)

(setvar "ctab" curtab)
(princ)
A man who never made a mistake never made anything