todorb2000 Posted January 6, 2009 Share Posted January 6, 2009 I have a some text's objects in the autocad drawing. So I need a lisp or vba to read them into Excel table and use it to text items values. Can anybody help me? Quote Link to comment Share on other sites More sharing options...
todorb2000 Posted January 6, 2009 Author Share Posted January 6, 2009 have a some text's objects in the autocad drawing. So I need a lisp or vba to read them into Excel table and use it to text items values. Can anybody help me? Quote Link to comment Share on other sites More sharing options...
wannabe Posted January 6, 2009 Share Posted January 6, 2009 have a some text's objects in the autocad drawing. So I need a lisp or vba to read them into Excel table and use it to text items values. Can anybody help me? I'm sure Lee Mac and co. will make light work of it . A new thread may be better, though. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 6, 2009 Share Posted January 6, 2009 Hi todorb2000, I think that is very possible. Just a few questions: Are all the text objects on their own layer? Do you want the user to select the text object him/herself - or have the program just select all text objects on a certain layer? Is is just single-line (DTEXT) or MTEXT? or a mixture of the two? Thanks Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 6, 2009 Share Posted January 6, 2009 Here: (defun c:TE () (c:TEXT_EXTRACTOR)) ; Program Shortcut (defun c:TEXT_EXTRACTOR (/ file xfile ss index ents txtval) ;; File Selection (defun selfile () (setq file (getfiled "Select/Create Excel File" "C:\\" "csv" 9 ) ;_ end getfiled ) ;_ end setq ) ;_ end defun (selfile) (if file (progn (setq xfile (open file "w")) ;; Text Retrieval (while (not ss) (setq ss (ssget '((0 . "TEXT,MTEXT")))) ) ;_ end while (setq index (1- (sslength ss)) ents 0 ) ;_ end setq (while (not (minusp index)) (setq txtval (cdr (assoc 1 (entget (ssname ss index))))) (write-line txtval xfile) (setq index (1- index) ents (1+ ents) ) ;_ end setq ) ;_ end while (close xfile) (princ (strcat "\n" (rtos ents) " Text Entities Written.")) ) ;_ end progn (alert "No File Selected.") ) ;_ end if (princ) ) ;_ end defun Quote Link to comment Share on other sites More sharing options...
Cad64 Posted January 6, 2009 Share Posted January 6, 2009 Todorb, please don't post the same question multiple times. Ask your question once and then wait for replies. Also, start a new thread when you have a question. Please don't tack your question on to someone else's thread. I have deleted your other posts concerning this issue and merged everything here. Lee Mac, I think I accidentally deleted your code from one of the other threads, but I see you have already re-posted it here. Sorry about that. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 6, 2009 Share Posted January 6, 2009 Thanks for thread-move Rod, much appreciated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.