transferring multi-texts from cad to excel sequentially

Discussion of other Lisp dialects (Arc, Clojure, AutoLisp, XLISP, etc.)

transferring multi-texts from cad to excel sequentially

Postby 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
RedaSobeh
 
Posts: 1
Joined: Mon Oct 09, 2017 4:24 am

Re: transferring multi-texts from cad to excel sequentially

Postby 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
User avatar
nuntius
 
Posts: 530
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA


Return to Other Dialects

Who is online

Users browsing this forum: No registered users and 0 guests