Wesley_Amsterdam Posted November 4, 2014 Share Posted November 4, 2014 Hi all, I have a drawing with z-coordinates in it as text. I would like to export all the text-objects with their x- and y-coordinates, and use the text content for the z-coordinate. Find the example attatched. I couldn't find anything with a websearch. Text2excel.dwg Quote Link to comment Share on other sites More sharing options...
MSasu Posted November 4, 2014 Share Posted November 4, 2014 Please check the built-in DATAEXTRACTION command. Apply it only for text entities and retain the Position X, Position Y and Value properties. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 4, 2014 Share Posted November 4, 2014 (edited) Try this . (defun c:Test (/ ss f o) ;; Tharwat 05.11.2014 ;; ;; Export Texts' values to Excel ;; (princ "\n << Select Texts to export to Excel : >>") (if (and (setq ss (ssget '((0 . "TEXT") ) ) ) (setq f (getfiled "Save as :" (getvar 'DWGPREFIX) "csv" 1)) ) (progn (setq o (open f "w")) (write-line "X-coordinate of text;Y-coordinate of text;Z-coordinate of text value" o ) ((lambda (i / sn p e) (while (setq sn (ssname ss (setq i (1+ i)))) (write-line (strcat (rtos (car (setq p (cdr (assoc 10 (setq e (entget sn)))))) 2 ) ";" (rtos (cadr p) 2) ";" (cdr (assoc 1 e)) ) o ) ) ) -1 ) (close o) ) ) (princ) ) Edited November 5, 2014 by Tharwat Quote Link to comment Share on other sites More sharing options...
Wesley_Amsterdam Posted November 5, 2014 Author Share Posted November 5, 2014 Hi Tharwat, Thanks for the tool! I miss the x- and y-coordinates in the list. Regards, Wesley Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 5, 2014 Share Posted November 5, 2014 I miss the x- and y-coordinates in the list. Are you talking about the X and Y of the Text location ? Show the outcome of the program as best as you looking for to allow me to write it for in one go . Quote Link to comment Share on other sites More sharing options...
Wesley_Amsterdam Posted November 5, 2014 Author Share Posted November 5, 2014 Hi Tharwat, The outcome should look like this. Thnx Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 5, 2014 Share Posted November 5, 2014 I updated the routine above , try it and let me know . Quote Link to comment Share on other sites More sharing options...
Wesley_Amsterdam Posted November 5, 2014 Author Share Posted November 5, 2014 Thnks Tharwat! Works great! Regards, Wesley Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 5, 2014 Share Posted November 5, 2014 Thnks Tharwat! Works great! Regards, Wesley You're welcome . Happy to help Quote Link to comment Share on other sites More sharing options...
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.