Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Audit_Purge_Zoom Extents_Save LISP

gunveet3QA9A
Explorer

Audit_Purge_Zoom Extents_Save LISP

gunveet3QA9A
Explorer
Explorer

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

0 Likes
Reply
Accepted solutions (3)
707 Views
7 Replies
Replies (7)

pendean
Community Legend
Community Legend
0 Likes

gunveet3QA9A
Explorer
Explorer

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

0 Likes

paullimapa
Mentor
Mentor
Accepted solution

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
0 Likes

gunveet3QA9A
Explorer
Explorer

Thanks for this Paul.

 

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

0 Likes

paullimapa
Mentor
Mentor
Accepted solution

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
0 Likes

gunveet3QA9A
Explorer
Explorer
Accepted solution

This works great. Thank you Paul!

0 Likes

paullimapa
Mentor
Mentor

Glad to have helped…cheers!!!


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