Batch purge

#1
Here is a small routine to batch purge multiple drawings. Requires doslib4.dll in intellicad search path, get it from here: http://ftp.mcneel.com/ftp/pub/doslib/doslib4.exe


(defun C:BPURGE (/ )
(if (not dos_dir) (xload "doslib4.dll"))
(setq files (dos_getfilem "Select files to purge.." "c:\\""Drawing Files (*.dwg)|*.dwg"))
(setq dwgpath (car files))
(if (/= files nil)
(progn
(foreach dwgfile (acad_strlsort (setq dwgsonly (cdr files)) dwgsonly)
(command "open" (strcat dwgpath dwgfile))
(setq oldclayer (getvar "clayer"))
(Command ".-layer" "m" "PurgeMeIfClean" "")
(setvar "clayer" oldclayer)
(command ".purge" "a" "A")
(command ".qsave")
(command ".close")
)
)
)
)
cron