Extract Multileader XY position along with name

Extract Multileader XY position along with name

ishaq03
Advocate Advocate
673 Views
1 Reply
Message 1 of 2

Extract Multileader XY position along with name

ishaq03
Advocate
Advocate

I wanted to use DATAEXTRACTION to export the X and Y coordinates of all multileaders in my drawing,along with text name but unfortunately there is no field containing this information. Is it somehow possible to export this data into a text file or something? I am attaching the dwg can I get any lisp to extract the geometry points of the multileader start arrow vertice point  along with name given in to a multileader.  I am attaching the DWG here.

0 Likes
674 Views
1 Reply
Reply (1)
Message 2 of 2

hak_vz
Advisor
Advisor
(defun c:mlxycont( / i ss f file1 ent p x y te)
	(setq
		i -1
		ss (ssget "X" '((0 . "MULTILEADER")))
		f (getfiled "Output CSV file:" (getvar "dwgprefix") "csv" 3)
	)
	(cond 
		((and ss f)
			(setq file1 (open f "w"))
				(while (< (setq i (1+ i)) (sslength ss))
					(setq
						ent (entget (ssname ss i))
						p (cdr (assoc 110 ent))
						x (rtos (car p) 2 2)
						y (rtos (cadr p) 2 2)
						te (cdr (assoc 304 ent))
					)
				(write-line (strcat te "," x "," y) file1)
				)
				(close file1)
		)
	)
(princ "\nDone!")
(princ)
)

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes