Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD export texts to Excel with multiple files

6 REPLIES 6
Reply
Message 1 of 7
Szabolcs.KovacsGGMKL
3419 Views, 6 Replies

AutoCAD export texts to Excel with multiple files

Hello Everyone!

 

I want to export texts from AutoCAD files to Excel. I have found the perfect lisp routine, it gets the job done with one file. I would like to use this on multiple dwgs. So I would choose a folder with dwgs in it, and the script would open all the drawings, would start the lisp, choose all texts in the drawings, and create Excel files for each drawing with similar names to dwgs where the text came from. 

What do you think? Is this possible? 

I've attached the lisp file that I'd like to use.

Labels (1)
6 REPLIES 6
Message 2 of 7

@Szabolcs.KovacsGGMKL 

 

For better understanding, and maybe get further help, please upload at least 3  such sample.dwg, and sample.xls how you need it to be 

 

Message 3 of 7

Using a script can open dwgs do your thing and close.

 

In your code there is (setq otcontents (ssget)) so it asks you to make a selection set a manual input, if you can make this a non user input eg (ssget "X" (list (cons 0 "INSERT")(cons 410 "Model"))) will get all blocks in model space.

 

So if you can explain more what you select it may be a quick solution.

Message 4 of 7


@Szabolcs.KovacsGGMKL wrote:

I want to export texts from AutoCAD files to Excel. I have found the perfect lisp routine,



Thats a very nice lisp routine, who is the author?

If we stick with that code, we can throw ODBX out of the window, That leaves you coreconsole and scripts.

 

Can you post a sample  drawing file and how it should look in xls?

 

EDIT: Now sea.haven posted before i did 😁

Message 5 of 7

The method would be simple, Select all text in dwg and create a new Excel file to each dwg and just put all the text in them.

Message 6 of 7

I don't know who the author is, it's not me, because I have no knowledge about lisps, I just try to use them.

This lisp keeps the format and position of texts fortunately, so the task would be just this: select all texts, create a new Excel file with the name of the dwg and put all texts in these Excel files.

Message 7 of 7


@Szabolcs.KovacsGGMKL wrote:

I don't know who the author is, it's not me, because I have no knowledge about lisps, 

...

The method would be simple, Select all text in dwg and create a new Excel file to each dwg and just put all the text in them.


Back to your request then, surely its either Model or Paper space. Which one then? 

Not really thoroughly tested the posted code, but what you can do is change the prompt for object selection to 

(setq otcontents  (ssget "X" (list (cons 0 "INSERT")(cons 410 "Model"))))

as @Sea-Haven  suggested. [ Note: YOU need to define the filter ]

 

Then, Look into Autoscript or ScriptPro, both are free and easy to use. to rub the lisp code on multiple drawings

 

HTH

 

 

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

Post to forums  

Autodesk Customer Advisory Groups