Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lisp needed for selecting text in enclosed entity and copy it to excel

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
davedt31
514 Views, 2 Replies

lisp needed for selecting text in enclosed entity and copy it to excel

Hi, 

Can anyone please help me in creating lisp for selecting text in enclosed entity and copy it to excel.

 

I have tried with below lisp but its not working out please help.

 

your help is highly appreciated,

 

(defun C:xport ( / ss elist at cmde cen rad p1i)
(setq cmde (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq ss 0 elist (entget (car (ssget "X" ' (list(( 0 . "POLYLINE" ) ( 8 . "avn" ))))))))
(setvar "OSMODE" (boole 7 (getvar "OSMODE") 16384))
(if (zerop (getvar "CMDACTIVE")) (command "_select"))
(command "_wp") ; or _CP
(if (= (cdr(assoc 0 elist)) "CIRCLE")
(progn
(setq cen (cdr (assoc 10 elist))
rad (cdr (assoc 40 elist))
)
(repeat 90 ; 360/4 0.06981317=4*pi/180
(setq p1 (polar cen (* ss 0.06981317) rad) ss (1+ ss))
; (command "_POINT" (trans p1 0 1))
(command (trans p1 0 1))
)); else
(repeat (length elist)
(setq at (nth ss elist) ss (1+ ss))
; (if (= (car at) 10) (command (cdr at)))
(if (= (car at) 10) (command (trans (cdr at) 0 1)))
)
);if CIRCLE
(command "")
(setvar "OSMODE" (boole 2 (getvar "OSMODE") 16384))
(setvar "cmdecho" cmde)
(progn
(setq fname (getfiled "Save Text File As:" "" "csv" 1))
(setq fn (open fname "w"))
(setq i -1)
(repeat (sslength ss)
(setq i (1+ i))
(setq en (ssname ss i)
elist (entget en)
txt (cdr (assoc 1 elist)))
(write-line txt fn))
(close fn)))
(princ (strcat "\n* Text file " fname " \n has been created *"))
(setvar "cmdecho" 1)

(setq fn fname)
(startapp (strcat "Notepad " (chr 34) fn (chr 34)))
(princ))
)

 

Thanks in advance.

 

2 REPLIES 2
Message 2 of 3
pendean
in reply to: davedt31

There is no lisp in LT, where you are posting: are you in the wrong forum or didn't know about LT's limitation?
Message 3 of 3
davedt31
in reply to: davedt31

Oops!!! Sorry I am in the wrong forrum.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost