script for closing drawings now needs to be automated

script for closing drawings now needs to be automated

Anonymous
Not applicable
1,161 Views
3 Replies
Message 1 of 4

script for closing drawings now needs to be automated

Anonymous
Not applicable

Hello,

 

Can someone advise how I should setup this script so it's not a hassle for the end user.

 

The script makes sure all drawings are saved in the same state when shut at the end of the day.

 

I want to create a save and close that uses the script I have put together to leave all drawings in the same state after use.

 

Please help!!

 

I have attached the script.

 

;; DWGEXIT.scr
;;
;;
;;
;;
LAYER SET 0
;;
PURGE ALL * N
;;
AUDIT Y
;;
XREF U *
;;
VISRETAIN 1
;;
ZOOM EXTENTS
;;
;;-END OF SCRIPT-

0 Likes
Accepted solutions (1)
1,162 Views
3 Replies
Replies (3)
Message 2 of 4

DannyNL
Advisor
Advisor
Accepted solution

Multiple options to achieve what you want, like i.e. create a custom button (ribbon/toolpalette) to run your script or a LISP routine

 

This code does the same as your script. You can include this code in one of the startup LISPs if you have one (ACADDOC.LSP/[MENU].mnl) or you can create a separate centralized file and add it to your APPLOAD startup suite (profile). With the last option make sure all users are loading and using your new/updated profile. Type the command QCLOSE to run.

 

(defun c:QClose ()
   (setvar "CLAYER" "0")
   (setvar "VISRETAIN" 1)   
   (repeat 3
      (command ".-PURGE" "ALL" "*" "N")
   )
   (command ".AUDIT" "Y")
   (command ".XREF" "U" "*")
   (command ".ZOOM" "E")  
   (command ".QSAVE")
   (command ".CLOSE")
)

 

Message 3 of 4

Anonymous
Not applicable

Thank you it works really well, added a open version as well.

0 Likes
Message 4 of 4

DannyNL
Advisor
Advisor

You're welcome and glad I could help Smiley Happy

0 Likes