This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

make script lisp-write-line error

3 posts · 4550 views

Hello,

I have a lisp from original author, LEEMAC on CADTutor...

I recoded it and used DOSLib.

Here is the code:
(defun c:rscr  (/ wfile rfile ofile n)
  (if (and (setq wfile "C:\\test.scr")
             (setq rfile (dos_getfilem "Select Drawings" 
                             "" "DWG Files (*.dwg)|*.dwg"))
	  )
    (progn
      (setq ofile (open wfile "w"))
      (foreach n
        '(write-line
          (strcat "open \"" rfile "\" (load \"mylsip.lsp\") (c:mylisp) close \"Y\"")
          ofile))
      (close ofile)
      (command "script" wfile))
    (princ "\n<!> File Selection Error <!>"))
  (princ))
The lisp creates the scr file allthough it do not write lines into it.
Can someone help me please..
I think its wrong with foreach and write-line functions...

Re: make script lisp-write-line error

I think that this is AutoLisp, not Common Lisp.

You should post this to "Other dialects", or a moderator might be able to move it there.

Anyway, it seems to me as if your write-line statement is quoted, thus not doing anything. I may be wrong, though, I am not familiar with AutoLisp.
"Just throw more hardware at it" is the root of all evil.
Svante