Bacgj Posted November 2, 2023 Posted November 2, 2023 Hello is there a lisp that will allow me to export linework into a x/y/z csv file along with also the field for the layer its on?? Thanks Quote
Steven P Posted November 2, 2023 Posted November 2, 2023 How does this work for a starter? https://autocadtutorial22.blogspot.com/2020/04/15-13a-autocad-export-coordinates.html ;;https://autocadtutorial22.blogspot.com/2020/04/15-13a-autocad-export-coordinates.html (defun C:c2exc2 (/ coords coor_list elist en fd fname i ss) (setq ss (ssget "_:S" '((0 . "*POLYL*,LINE,CIRCLE,ARC,ELLIPSE,SPLINE,POINT"))) i -1 ) (repeat (sslength ss) (setq i (1+ i) en (ssname ss i) elist (entget en) coords (vl-remove-if (function not) (mapcar (function (lambda (x)(if (eq 10 (car x))(trans (cdr x) 0 1)))) elist) ) coor_list (cons coords coor_list)) ) (setq coor_list (reverse coor_list)) (setq fname (getfiled "Type file name" "" "csv" 1)) (setq fd (open fname "w")) (foreach coors coor_list (foreach i coors (princ (strcat (rtos(car i)) "\t" (rtos (cadr i))"\t" (rtos (caddr i)) "\n") fd ) ) ) (close fd) (princ) ) 1 Quote
BIGAL Posted November 3, 2023 Posted November 3, 2023 Has been asked many times before Google "export linework co-ordinates to csv Autocad lisp" Again post a sample dwg . "also the name for the layer its on??" Do you want direct to excel ? Do you want line counts by layer and length ? Just getting to the next request after code is posted. 1 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.