Message 1 of 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I am trying to write a lisp to export the layout names + drawing name (mtext at same coordinates in the paperspace - first point is x = 795, y = 41 second point in window x = 696, y = 26 ) to a csv file . this is essentially just exporting a drawing list for me.
I am essentially trying to modify one of leemacs from memory but am really struggling on where to next. Would be greatly appreciated if anyone could fill in the blanks or give some info.
(defun c:csvlist ( / des dim enx idx sel txt )
(if (and (setq sel (ssget '((0 . "MTEXT"))))))
(setq des (open (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) ".csv") "a"))
)
(progn
(setq lay (getvar 'ctab'))
(setq txt (ssget "_W" '(795 41) '(696 26))
)
)
(while (or dim txt)
(write-line
(strcat
(cond ((car lay)) ("")) ","
(cond ((car txt)) (""))
)
des
)
(setq txt (cdr txt)
lay (cdr lay)
)
)
)
)
(if (= 'file (type des)) (close des))
(princ)
)
ive got to many brackets in there somewhere which I cant locate (how can i find where the break is??? ive checked in lisp console but cant work it out)
thanks again
Solved! Go to Solution.