Mepspec Posted November 8, 2021 Posted November 8, 2021 Hi everybody Can someone write me a lisp-code to export points to CSV? 1) User should select the entities 2) Enter Lisp Command 3) Windows explorer should appear, where to save the csv File with the points X-Y-Z I would be very very happy for that! 1000 Thanks! Quote
hosneyalaa Posted November 8, 2021 Posted November 8, 2021 hi try http://www.lee-mac.com/ptmanager.html Quote
Mepspec Posted November 8, 2021 Author Posted November 8, 2021 14 minutes ago, hosneyalaa said: hi try http://www.lee-mac.com/ptmanager.html Thank you, is there a solution without a GUI Menu? Quote
hosneyalaa Posted November 9, 2021 Posted November 9, 2021 (edited) 19 hours ago, Mepspec said: Thank you, is there a solution without a GUI Menu? Example (defun c:testex ( / FILENAME FO LST NUM SS STR TLK X) (setq ss (ssget (list (cons 0 "point")))) (if (/= ss nil) (progn (setq filename (getfiled "NAME THE EXPORT FILE" (strcat (getvar 'dwgprefix) (getvar 'dwgname)) "csv" 1)) (setq fo (open filename "a")) (setq num 0) (repeat (setq x (sslength ss)) (setq tlk (ssname ss (setq x (- x 1)))) (setq lst (cdr (ASSOC 10 (ENTGET tlk)))) (setq str (strcat (rtos (setq num (1+ num)) 2 0) ";" (rtos (nth 0 lst) 2 2) ";" (rtos (nth 1 lst) 2 2) ";" (rtos (nth 2 lst) 2 2) ) ) (write-line str fo) ) (close fo) ) ) (princ) ) Edited November 9, 2021 by hosneyalaa change Quote
Recommended Posts
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.