In this Article...
Are you familiar with data extraction? It’s a great tool to generate reports from any object properties in your drawing. Unfortunately, this tool is only available in AutoCAD, not in AutoCAD LT.
Many people don’t know that AutoCAD LT (and AutoCAD) has a similar tool to data extraction. Unfortunately, this tool is limited to extract block properties and block attributes.
Yes, it’s limited. But if you need to create a schedule or report from blocks in your drawing, then this tool can help.
If you want to try this feature with the same drawing file, you can download the DWG file here.
Creating the template file
The first thing you need to do is to create a template file. You can create it using notepad.
In the text file define what you want to extract. Add in each line the properties you want to extract.
The format is:
Properties name [space] format.
BL:NAME Cwww000
- For block name, the properties name is BL:NAME
- Block name using characters (string) and I limit the name length to 16 characters. So I added C then I replace the www with 016.
- 000 is used for the number of decimal places if the format is number. But for characters, it’s always 000.
So for block name in my template, I write:
BL:NAME C016000
I also want to extract my block’s attribute. In this sample, the attribute tag for the door is DOORTYPE. And for windows it’s WINDOWTYPE.
Add the attribute tag’s name in separate lines.
So my template file would be like this.
Now we can save this template as .txt file.
Block has 15 extractable properties. If you want to see all 15 block properties, you can see all possible fields in this AutoCAD help page. And certainly, you can add your own attributes.
Using Attribute Extraction
After we define the extraction template, we can extract the attributes now.
Type ATTEXT at the command line.
You can leave CDF as the file format. Now click Select objects and select blocks you want to extract. In this sample, you can select everything. AutoCAD will process only blocks with attributes.
Notice that the columns are also blocks. But ATTEXT will not process it because they don’t have attributes.
Select the template file and output file, then click OK.
This is the attribute extraction result.
Opening the extraction result in Microsoft Excel
The result may look unreadable. Now let’s open it in Microsoft Excel to finish the report.
Open Microsoft Excel. Then click the open file button. Open the extraction result. Don’t forget to change the file type to all files.
Excel will open file import wizard.
In the first step, leave the format as delimited. Click next.
The second step is an important step. Change the delimiters to the comma. And change the text qualifier to a single quotation mark.
As you can see, the data preview is now showing the correct format.
You can click finish now.
You should be able to see your extraction result correctly in Excel now!
Video Guide
You can follow all the steps above in the video below.
You still need some works to do
As you can see, you still have some works to do to finish the schedule. You can do it in Excel to sum the total number of doors and windows. However, using attribute extraction is much better than count them manually.
You also may need to add attributes to your blocks to extract the data correctly. If you are not familiar with block and attributes, you may be interested to read our “AutoCAD Block Best Practices” e-book.
So do you think this feature is useful? As an AutoCAD user, in which situation attribute extraction is better than data extraction? And for AutoCAD LT users, do you think this feature is useful?
works perfectly for what i am using it for. i have just one gripe. when i extract the data and it counts all the instances of say 1 particular type with both text and numerical values how can i get this to order all matching values into 1 line? i think i have to do it in excel but i am having difficulties getting it to do what i would like.
Thanks again.
I only get error : ** Invalid field specifacation.
I’m using :
BL:NAME C016000
DOORTYPE C003000
WINDOWTYPE C003000
what did i wrong?
Hi,
I’ve made a template file with 12 attributes.
I get the message “field error”.
I’ve tried several template files all saying the same thing “field error”
So I made a template file with just the name.
BL:Name C008000 and it still says field error
What am I doing wrong?
Thanks in advance
Crawford
Hello,
I downloaded your Acadfile and created a tamplate file like yours but i doesn’t work here…?
I don’t know whay I’m doing wrong.
Hi Filip,
Did you type the template file content or copy and paste it from the website?
What result did you get after you run the command?
Thank you very much for a clear step-by-step tutorial. I looked for days for an explanation for my enability to use the “dataextraction” command in AutoCAD LT 14. While it will take some preparation and practice, the ATTEXT command is certainly useful.
I am glad I found your post. You have done a great job outlining how to extract data. This is exactly what I have been trying to do in LT. Your examples were easy to follow, and worked great. Keep up the good work.
Thank you!
Thank You! This is a life saver. I don’t have the budget for full blown AutoCAD at this time but counting blocks is a huge part of my job as a furniture planner.
Glad that I can help!
If you only want to count block, you might be interested in this workaround: https://www.cad-notes.com/bcount-alternative-for-autocad-lt/
Thanks so damn much… always used attout. Now I’m good thanks to your post… Thank you!
I work for CUC, the utilities of Commonwealth of the Northern Marianas Islands. I am trying to extract some attributes from my autocadd drawings and I’m having problems. I followed the template you provided but it keeps saying invalid. Could you assists me
Zeno
The template I provided was specifically for drawing in my example. You need to define your own template by following the tutorial. Or modify it to match your block attributes.