help with vla-zoomextents

help with vla-zoomextents

DC-MWA
Collaborator Collaborator
961 Views
6 Replies
Message 1 of 7

help with vla-zoomextents

DC-MWA
Collaborator
Collaborator

Hi all,

I have a routine that closes all drawings except the active drawing. I'm trying to get it to zoom extents before closing each drawing.

I have tried with vla-zoomextents, i cannot get it to work.

I have attached the lisp with all my failed attempts within.

thanks,

DC

0 Likes
962 Views
6 Replies
Replies (6)
Message 2 of 7

SeeMSixty7
Advisor
Advisor

Based on what I can see with that function is it works at the ACADObject Level an only on the active dwg and active viewport. To utilize it you would need to make each document active and then apply the zoomextents method.

 

Good luck,

0 Likes
Message 3 of 7

DC-MWA
Collaborator
Collaborator

Thank you.  Bummer.

0 Likes
Message 4 of 7

Sea-Haven
Mentor
Mentor

Here is a do all layouts, you may want to change the zoom c value it does not need to be super accurate.

 

; goes trhough all layout tabs and zooms all
; By Alan H june 2011
(vl-load-com)
(defun zall ( / d curtab)
(command "_.pspace")
(setq curtab (getvar "Ctab"))
(foreach d (layoutlist)
  (setvar "CTAB" d)
  (COMMAND "pSPACE")
  (command "zoom" "C" "400,277" 750) ; in case junk around title block
)
(setvar "ctab" curtab)
(princ)
)
(zall)
0 Likes
Message 5 of 7

dbroad
Mentor
Mentor

The downsides of such an autoclose all command:

  • Extents might not be the best view and might cause more issues when opening the drawing later.
  • Automatically saving a drawing that hasn't been changed. This messes with the file date and reduces the value of the backup file to gain access to the previous version.
  • Automatically saving a drawing that has been damaged by some process that was intended to be temporary, such as deleting layers or adding items that were to be copied to other drawings.

Any process that removes the drafter from responsibly closing the programs causes more problems than it fixes.  Whenever I rush the closing process, I regret it.

Architect, Registered NC, VA, SC, & GA.
Message 6 of 7

DC-MWA
Collaborator
Collaborator

Thank you.

0 Likes
Message 7 of 7

DC-MWA
Collaborator
Collaborator

All these points are valid and true.

I have been using acad for decades. I keep track of when and when not to save on close.

Thank you for your input.

 

0 Likes