Just thought I'd share the finished product. Modified Kennet's code (thank you so much again kennet...what I've learned about creating a script from within Lisp is invaluable and I will use it a lot in future applications...)
It is working like a charm so far....Here is what I came up with:
Code:
(defun c:BatchLock
(/ UserFile UserCat FileList File#1 DwgName FileName)
(vl-load-com)
(setq UserFile
(getfiled "Select a drawing within the directory to process"
"c:/"
"dwg"
16
)
)
(setq UserCat (vl-filename-directory UserFile))
(setq FileList (vl-directory-files UserCat "*.dwg" 1))
(setq File#1 (open "c:/Lockup.scr" "w"))
;; open/make a scriptfile to write to
(foreach DwgName FileList
(setq FileName (strcat "\"" UserCat "\\" DwgName "\""))
(princ "open\n" File#1)
(princ (strcat FileName "\n") File#1)
;;Below are commands to run on each drawing...
(princ "audit\n" File#1)
(princ "Y\n" File#1)
(princ "(load \"BatchLockRun.vlx\")\n" File#1)
(princ "(C:BATCHLOCKRUN)\n" File#1)
(princ "audit\n" File#1)
(princ "Y\n" File#1)
(princ "_.qsave\n" File#1)
(princ "_.close\n" File#1)
)
(close File#1)
(command "script" "C:\\Lockup.scr")
(princ)
)
(princ "\nBatchLock loaded.")
(princ)
Thanks again to everyone for their help!!