Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Export Selected Text to excel

Anonymous

Export Selected Text to excel

Anonymous
Not applicable

I am wondering if any of you fine people can point me in the right direction. I came up with an ssget function that selects the text I'm looking for, but I'm not quite sure where to go from there to extract the text to either a txt or csv file.

 

Here is the ssget function that is working for me

 

(ssget "_X" '((0 . "TEXT,MTEXT")(1 . "ETCH*,MARK*,STAMP*")))

 

I need to grab this text from a folder full of drawings and export it to excel I can easily read and compare.

 

Thanks in advance!

Allan

0 Likes
Reply
Accepted solutions (1)
5,008 Views
4 Replies
Replies (4)

cadffm
Consultant
Consultant
Thats only 1% of what you need.
Perhaps it is an option for your to use DATAEXTRACT, for all text in files (perhaps in 4-6 steps if you have too many large files).
You can filter for only Model or Paperspace i am thinking.

Afters creating the excel files you can filter the wantet item on Excel.

Not an option?
-get textinformation from selectionset
-write data to a textfile(*.csv) with open and write-line & close.
For batch, you can create a *.scr file to load/run your lisp,
use ScriptPro (google) for run the script on multiple files.

Do you want to learn the other 99% or you want a ready solution now?

Sebastian

0 Likes

Anonymous
Not applicable

Thank you for your reply! Definitely gives me somewhere to start.

A ready solution would be nice as there's a bit of a time crunch on this but I certainly want to learn the other 99% vs copying code that works but I don't really understand so that is a hard question to answer!

 

I should be able to to figure out how to grab all the text and filter it out in excel. I've just been exposed to LISP last week and definitely would like to know more as it is extremely useful for what I will be doing. Would you be kind enough to point me to a good resource for learning what I need to do to complete this task or maybe explain a few commands I would use and I can figure out how to put it all together.

 

Thanks again for your help so far I really appreciate it!

0 Likes

cadffm
Consultant
Consultant
Accepted solution

Ok, for now you have the workaround without lisp (dataextract all textobjects of all files and filtering in Excel).

 

About learning for a Lisp solution starting without any knowledge:

For me and now that is to much and not the way that i teach to learn lisp, other helpers will help you about that - sorry.

 

As first, look how AutoLisp see the world (copy&paste into commandline):
(progn(foreach i (entget(car(entsel))) (print i))(princ))
F1 - DXF Group Codes in Numerical Order Reference

 

 

Buy a analog book, there are hundreds available-

For Tutorials use google, for example here: http://www.afralisp.net/index.php

 

F1 is a good source to read about the functions.

And one course to learn about the VLide and programming : http://help.autodesk.com/view/ACD/2018/DEU/?guid=GUID-66377097-9BDB-4E3D-97E6-2263A5F273EC

 

 

 

 

Sebastian

0 Likes

Anonymous
Not applicable

Thanks again for the info, I do have a way to get this working to make everyone happy for now. I will look into those resources to start getting into lisp. 

 

Thanks again for your time and pointing me in the right direction! I really appreciate the help!

0 Likes