- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Here is a simple routine I have always performed prior to closing a file. (dbl pu with dbl qsave catches some unwanted garbage from block editing, at least that was passed onto me via adsk support). I do know if I open a file that displays a recover msg and I choose no but rather perform these tasks the file opens without the recover notice.
Anyways take that info as you whish . . .
;; PURGE TWICE
;; ZOOM EXTENTS
;; REGEN ALL 2X
;; QUICK SAVE 2X
(defun c:CLN (/ response)
;; Run PURGE ALL twice with a slight pause in between
(command "._-PURGE" "ALL" "*" "N")
(command "._delay" 250)
(command "._-PURGE" "ALL" "*" "N")
;; Zoom extents
(command "_ZOOM" "_EXTENTS")
;; Regen all
(command "_REGENALL")
(command "._delay" 250)
(command "_REGENALL")
;; Quick save
(command "_QSAVE")
;; Short delay to avoid write error
(command "._delay" 250)
;; Quick save again
(command "_QSAVE")
;; Display completion message and sound
(alert "CLEAN AS A WHISTLE")
;; Prompt to close the file
(setq response (getstring "\nDo you want to close the file? (Y/N) <N>: "))
;; Close the file if the response is "Y" or "y"
(if (or (= response "Y") (= response "y"))
(command "_CLOSE")
(princ "\n")
)
(princ)
)
;; Display message after LISP is loaded
(princ "\nType \"CLN\" To Initiate Cleanup and Exit with Choice.")
(princ "\n")
-Best Regards
-Tim C.
Solved! Go to Solution.