Jump to content

Recommended Posts

Posted

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

Posted

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)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...