Announcement

Collapse
No announcement yet.

Newbie Needs Help

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Newbie Needs Help

    I am trying to create a lisp for exporting mtext to a csv file for use in excel and am running into issues. I am new to writing as I have only previously done minor modifications and now want to learn more. I am getting a "malformed list on input" error on the following code:

    Code:
    (defun c:MTO (/ elist en fn fname i ss mtxt)
     (if (setq ss (ssget (list (cons 0 "MTEXT")))
     (progn
     (setq fname (getfiled "Save Text File As:" "" "csv" 1))
     (setq fn (open fname "w"))
     (progn
     (setq a (ssget))
     (if (eq (get object ALL) "MTEXT")
     (write-line txt fn)
     ))
     (princ
     (strcat "\n* Text file " fname " \n has been created *")
     )
     (setq fn fname)
     (startapp (strcat "Excel " (chr 34) fn (chr 34)))
     (princ)
     )
    Any help would be greatly appreciated.

Working...
X