Page 1 of 1

transferring multi-texts from cad to excel sequentially

Posted: Sun Oct 15, 2017 5:13 am
by RedaSobeh
PLZ,
I need to edit to that lisp code for extracting texts values itself with their coordinates;
because that lisp extracts only the coordinates (E,N) of positions of texts without texts ...

Code: Select all

(defun c:pall()
	(setq fa (getstring "nFile Name : > "))
	(setq fff (open fa "a"))
        (prompt "nSelect Points = ")
	(setq group (ssget ))
	(setq ssl (sslength group))
	(setq count 0)
	   (while (< count ssl)
		(setq snam (ssname group count))
		(setq xcx (entget snam))
		(SETQ VVV1 (ASSOC '10 XCX))
		(setq xp (cadr vvv1))
		(setq yp (caddr vvv1))
		(setq zp (cadddr vvv1))
                (setq sss (strcat (rtos xp 2 3) "," (rtos yp 2 3) "," (rtos zp 2 3)))
                (write-line sss fff)
                (setq count (1+ count))
	  )
(close fff)
)

(princ)

Re: transferring multi-texts from cad to excel sequentially

Posted: Thu Oct 19, 2017 6:06 pm
by nuntius
I'm no AutoLisp expert, but I believe that (assoc 0 xcx) will return "TEXT", and (assoc 1 xcx) will return the desired text value.
Use these in the strcat function as desired.

http://www.jefferypsanders.com/autolisp ... .html#Text

https://www.autodesk.com/techpubs/autoc ... dxf_06.htm

https://knowledge.autodesk.com/search-r ... A-htm.html