Originally Posted by
bcgatti
Ed and tedg,
Thanks for the feedback. I'll take a look at ScriptPro and see what I can do.
Brett
I was able to dig up what I was talking about with the batch file, script file and lisp file.
If you don't want to go the ScriptPro route.
This is an example, so you will need to add your file paths and programs accordingly:
This is the batch file named "Ted_Purge.bat" it starts AutoCAD, opens each drawing in the folder "C:\lisp\Ted_Purge" and runs the script file "Ted_Purge.scr"
Code:
FOR %%f in (C:\"lisp"\"ted_purge"\*.dwg) do start /wait C:\"Program Files"\"Autodesk Architectural Desktop 2006"\acad.exe "%%f" /b "C:\lisp\ted_purge\ted_purge.scr"
This is the script file named "Ted_Purge.scr" named above which loads and runs the "Ted_Purge.lsp" routine and then saves and quits:
Code:
(load "C:\\lisp\\ted_purge\\TED_PURGE.lsp")
P6
QUIT
Y
And this is just the simple purge routine "Ted_Purge.lsp" you would use your routine for your purpose:
Code:
(defun c:p6 ()
(setq ce (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "layer" "s" "0" "")
(command "zoom" "e" "zoom" ".9x" )
(repeat 3
(command "._purge" "_A" "*" "_N")
(command "purge" "regapps" "" "n"))
(setvar "cmdecho" ce)
(command "_qsave")
(princ)
)
Hope it helps!