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.
- 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:
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!
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?