- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Please find below lisp I'm using manually adding commands to run the lisp.
I would like to make it as lisp should call csv file (data) and execute the lisp.
Below is the lisp (never mind other functions of lisp)
(defun c:mk ( / *error* osm tag) (defun *error* (msg) (if osm (setvar 'OSMODE osm) ) (cond ((not msg)) ((member msg '("Function cancelled" "quit / exit abort"))) ((princ (strcat "\n** Error: " msg " ** "))) ) (princ) ) (setq osm (getvar 'OSMODE)) (setvar 'OSMODE 0) (if (not (tblsearch "APPID" "Ishwinder_LineTag")) (regapp "Ishwinder_LineTag") ) (defun tag (name) (entmod (append (entget (entlast)) (list (list -3 (list "Ishwinder_LineTag" '(1002 . "{") (cons 1000 name) '(1002 . "}")))))) ) (command "_layer" "n" "_3D_poly" "") (command "_layer" "c" "82" "_3D_poly" "") (command "_layer" "s" "_3D_poly" "") (command "_3DPOLY" "3835007,3178626,21298" "3835007,3178626,20200" "3835007,3185013,20200" "3817101,3185013,20200" "") (tag "cable-1") (*error* nil) (princ) )
in above codes, I want to keep following data in csv file
(command "_layer" "n" "_3D_poly" "")
(command "_layer" "c" "82" "_3D_poly" "")
(command "_layer" "s" "_3D_poly" "")
(command "_3DPOLY" "3835007,3178626,21298" "3835007,3178626,20200" "3835007,3185013,20200" "3817101,3185013,20200" "")
(tag "cable-1")
these 5 lines I kept for example, like this there are more than 1000 lines (basically commands).
So I want to edit that lisp, it shall call csv file to get these data to execute it.
I hope it can be done..
kindly help me out.
Thanks
mk
Solved! Go to Solution.