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

Audit_Purge_Zoom Extents_Save LISP

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
gunveet3QA9A
572 Views, 7 Replies

Audit_Purge_Zoom Extents_Save LISP

Hi All,

I'm looking for LISP file that could Audit, Purge, Zoom extents the whole drawing(including layouts),  & Save the file. 

 

I'm hoping someone else has already created one. If not, could someone help me create one?

 

Thanks

Labels (5)
7 REPLIES 7
Message 2 of 8
pendean
in reply to: gunveet3QA9A

Message 3 of 8
gunveet3QA9A
in reply to: pendean

Not yet...been looking for a few days now.

Message 4 of 8
paullimapa
in reply to: gunveet3QA9A

for zoom extents on all layouts:

(repeat (setq i (length (layoutlist)))(setvar "ctab" (nth (setq i (1- i)) (layoutlist)))(vla-zoomextents (vlax-get-acad-object)))

for purge all:

(vl-cmdf "_.-Purge" "_All" "*" "_N")

for Audit:

(vl-cmdf "_.Audit" "_Y")

lastly:

(vl-cmdf "_.Qsave")

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 5 of 8
gunveet3QA9A
in reply to: paullimapa

Thanks for this Paul.

 

How would I be able to convert this into a LISP file?

Message 6 of 8
paullimapa
in reply to: gunveet3QA9A

Just do this

(defun c:doit ()
; place all the lines of code here
)

Save file as doit.lsp in AutoCAD file support search path and 

then at command prompt enter

(load"doit")

then to run the code enter command:

doit 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 7 of 8
gunveet3QA9A
in reply to: paullimapa

This works great. Thank you Paul!

Message 8 of 8
paullimapa
in reply to: gunveet3QA9A

Glad to have helped…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report