Hello
I have this lisp from LEEMAC on CADtutor which writes a script file and then executes a command in lisp:
Here is the code
(defun c:rscr (/ wfile rfile ofile dir)
(if (and (setq wfile "C:\\test.scr")
(setq rfile (getfiled "\nSelect File from Directory to Read: " "" "dwg" 8)))
(progn
(setq ofile (open wfile "w"))
(foreach x (vl-directory-files (setq dir (vl-filename-directory rfile)) "*.dwg" 1)
(write-line
(strcat "open \"" dir "\\" x "\" (load \"mylisp\") (c:mylisp) close \"Y\"")
ofile))
(close ofile)
(command "script" wfile))
(princ "\n<!> File Selection Error <!>"))
(princ))
I cant multiple select files here.
I know that I can select files "multiple selection" without DCL and with DOSLib.
I wrote a bit of code and changed that.
Now .. with dos_getfilem I can choose multiple files.
But I think that the lisp cant understand whjat files are chosen when I try to writle-line to the script file... the format of it...
Can anyone help.
Here below is the code I tried to manipulate.
(defun c:rscr (/ wfile rfile ofile dir)
(if (and (setq wfile "H:\\test.scr")
(setq rfile (dos_getfilem "Select Drawings"
"" "DWG Files (*.dwg)|*.dwg"))
)
(progn
(setq ofile (open wfile "w"))
(foreach rfile
(write-line
(strcat "open \"" rfile "\" (load \"mylisp\") (c:mylisp) close \"Y\"")
ofile))
(close ofile)
(command "script" wfile))
(princ "\n<!> File Selection Error <!>"))
(princ))