transferring multi-texts from cad to excel sequentially

Discussion of other Lisp dialects (Arc, Clojure, AutoLisp, XLISP, etc.)
Post Reply
RedaSobeh
Posts: 1
Joined: Mon Oct 09, 2017 4:24 am

transferring multi-texts from cad to excel sequentially

Post by RedaSobeh » Sun Oct 15, 2017 5:13 am

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)
Last edited by nuntius on Thu Oct 19, 2017 5:49 pm, edited 1 time in total.
Reason: added [code] tags

nuntius
Posts: 538
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Re: transferring multi-texts from cad to excel sequentially

Post by nuntius » Thu Oct 19, 2017 6:06 pm

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

Post Reply