Hi -- for the first time,
We have a lisp routine that updates all the drawings in a directory to the current version of ACAD. We now run the routine, which worked in the past, and it crashes with a DOS window appearing that says:
"The system can not find the specified path"
Could someone take a look at this for us and correct whatever is going wrong.
We know zip about lisp ... been meaning to learn but the work load here is such that finding the time to do the studying is next to impossible.
Hi Larry
If you need rewrite this lisp try this one
(tested in A2005)
Thank you
f.
[code
;; BASED ON BCONVERT.LSP
;; MAIN ROUTINE
(prompt "\n\t***\tType BCD to run batch file operation.\t***\n")
(defun C:BCD (/ afile file_list strp_path)
(alert "This routine does a zoom extents on an entire directory. Click OK to continue.")
(setq afile (getfiled (strcat "Select the first DWG file in folder "
"to be processed") "" "DWG" 0))
(setvar "filedia" 0)
(setvar "cmdecho" 0)
(if afile
(bprocess afile )
(alert "You must select any dwg file of the directory \n
to be processed. Conversion halted.")
)
(setvar "filedia" 1)
(setvar "cmdecho" 1)
(princ)
)
;; Core processing
(defun bprocess (afile / file_list scrfile fp file)
(setq strp_path (strcat (vl-filename-directory afile) "\\"))
;;; (setq tempfile (strcat strp_path "temp.dwg"))
;;; (if (findfile tempfile)
;;; (command "_SAVE" tempfile "y")
;;; (command "_SAVE" tempfile)
;;; );=>Why?
(setq file_list (vl-directory-files strp_path "*.dwg"))
(setq file_list (mapcar (function (lambda (x) (strcat strp_path x))) file_list))
(setq scrfile (strcat strp_path "convertst.scr")) ; Begin building processing script
(setq fp (open scrfile "w"))
(princ (strcat "CMDECHO" " " "0" "\n") fp)
(princ (strcat "ATTDIA" " " "0" "\n") fp)
(foreach file file_list ; Add each drawing to script
(write-line (strcat "_OPEN " "\"" file "\"") fp) ; OPEN
(write-line (strcat "_ZOOM" " " "_E") fp) ; ZOOM...E
(write-line (strcat "_QSAVE\n" " " "_CLOSE") fp) ; SAVE&CLOSE
)
(princ (strcat "CMDECHO" " " "1" "\n") fp)
(princ (strcat "ATTDIA" " " "1" "\n") fp)
(close fp)
(alert "Be patience...now is load script")
(command "_DELAY" 1500)
(command "_SCRIPT" scrfile) ; Run the script
(princ)
)