au-s Posted October 12, 2010 Posted October 12, 2010 Hi guys, I know that that had been discussed. I have this little lisp that opens a scriptfile in a temp path of the Operating System. Writes a line to load a lisp and close it and save it. The lisp opens the files chosen BUT it do not save them. I tried to type (command "_qsave") in the lisp I am processing on the drawings but then it stops after executing the first one. The multiBatch lisp is by the way taken from the Afralisp some years ago. It needs DOSlib to be installed just for opening the files, and getting the tempdir of the Operating System. In there the scr file is stored and always overriten. (defun c:MULTI (/ flag thelist thedir nfiles thefile fn ctr dname) (progn (setq thelist (dos_getfilem "Choose Files:" "" "DWG Files (*.dwg)|*.dwg")) ;retrieve the directory (setq thedir (car thelist)) ;retrieve the file names (setq thelist (cdr thelist)) ;get the number of files (setq nfiles (length thelist)) (setq thefile (strcat (dos_tempdir) "temp.scr")) (setq fn (open thefile "w")) (setq ctr 0) (repeat nfiles (setq dname (nth ctr thelist)) (write-line (strcat "open \"" thedir dname "\" (load \"c:mylisp.lsp\") (c:test) close \"Y\"") fn) (setq ctr (1+ ctr)) );end repeat (close fn) (setvar "cmdecho" 0) (command "_script" thefile) (princ "\n<!> DONE <!>") );; end progn ;; end if (princ) );;; end defun So, the main issue here is that this do not save the file after processing a command c:test from a loaded lisp, mylisp.lsp Quote
au-s Posted October 12, 2010 Author Posted October 12, 2010 I managed with changing to this: (write-line (strcat "open \"" thedir dname "\" (load \"C:mylisp.lsp\") (c:test)" ) fn) (write-line "_.QSAVE" fn) (write-line "_.CLOSE" fn) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.