;TX2ASC.LSP - (c) 1997 Tee Square Graphics ; ; Finds all TEXT objects in current drawing, then creates tab-delimited ; list of Handles and Strings in a file named TEXTLIST.ASC. ; ; Name of output file is defined in line 04, could be full path if needed. ; ; File's line format (i.e., Handle "") is set by Line 12. ; ; Eliminate lines 05 and 06 if column headers aren't wanted. ; ; At AutoCAD command line, type (load "TX2ASC") to load, ; and TX2ASC to run. ; (defun C:TX2ASC (/ ss n outf txt hd) ;01 | (setq ss (ssget "x" (list (cons 0 "TEXT"))) ;02 | Get TEXT objects. n (1- (sslength ss)) ;03 | Count them. outf (open "textlist.asc" "w")) ;04 | Create empty file. (write-line "Handle\tValue" outf) ;05 | Write column headings (write-line "------\t-----" outf) ;06 | to file. (while (>= n 0) ;07 | (setq txt (entget (ssname ss n)) ;08 | Get an object from set. hdl (cdr (assoc 5 txt)) ;09 | Extract its handle txt (cdr (assoc 1 txt)) ;10 | and String Value. n (1- n)) ;11 | Decrement the count. (write-line (strcat hdl "\t\"" txt "\"") outf)) ;12 | Write a line to file. (close outf) ;13 | Done...close the file. (princ) ;14 | ) ;15 |