;AUTOPURG function to automatically purge all unused blocks, layers, etc
;Created to work with RUN LISP, our drawing batch processing program.

;The system variables CMDDIA and FILEDIA must be set to zero.

;Copyright (c) 1995 by Sierra Hermitage
;
;Sierra Hermitage
;Rod Young, programmer
;140 Mesa Vista Drive
;Bishop, CA  93514
;Phone 619-387-2479 (voice)   619-387-2488 (data/fax, seldom enabled)
;E-mail hermit1@ix.netcom.com

(defun AUTOPURG ()
        (command "_purge" "a" )
        (while (= (getvar "CMDNAMES") "PURGE")
                (command "y" )
        );end while
		;save the changes - do this if your program makes wanted changes
		;to the drawing
        (command "_qsave" )
)
;make this program 'load and go' by running itself
;Be sure to do this in all programs to be used with RUN LISP
(autopurg)