--- In cadprog@yahoogroups.com, "Tara" <cc_tara@...> wrote:
>
> hi everyone
> if anybody knows about how export text from a dwg file please help
me
>
Dear Tara
copy save this funtion as c:\text2file.lsp file
On Command prompt type
Command: (load "c:\\text2file.lsp") <--'
C:TEXT2FILE
Command: text2file <--'
and select text it will save file on c:\news_text.txt
;-------------------- text2file.lsp ---------------------------------
(defun c:text2file ()
(setq fin (open (strcat "c:\\news_text.txt")"W"))
(if fin
(progn
;(setq alltext_set (ssget "x"'((-4 . "<OR")(0 . "TEXT")
(0 . "MTEXT") (-4 . "OR>")))) ; auto select all text and mtext
(setq alltext_set (ssget)) ; select text one by one
(setq cnt 0)
(repeat (sslength alltext_set)
(setq ent1 (ssname alltext_set cnt))
(setq entlst (entget ent1))
(setq textlin (cdr (assoc 1 entlst)))
(write-line textlin fin)
(setq cnt(1+ cnt))
)
(close fin)
(alert (strcase (strcat "\nText saved in file
c:\\news_text.txt")))
)
)
)
;------------------------------------------------------------------