In one of the first posts of this Deep Dive on Blocks (Blocks and Attributes) we explored adding attributes to a block. Attributes add variable text to the block, providing the ability to insert multiple instances of the same block definition but each one with different attribute text information. This is great, but an even more powerful feature is the ability to extract attributes. Within AutoCAD you can extract the attribute information from one drawing or a collection of drawings… to an external file or as a table into the drawing… and its easy!
Like most things in AutoCAD there are multiple methods of accessing the Data Extraction wizard. First is straight up in the Ribbon > Insert tab > Linking & Extraction panel > Extract Data button.
Secondly, within the Insert Table dialog select “From object data in the drawing (Data Extraction)“
Data Extraction is completed via a wizard, an 8-step process.
The first step is either create or select the data extraction template. As its describes the data extraction wizard requires a template to proceed. The advantage here is if you will be repeating similar extractions you can reuse the template file to extremely simplify the process.
Next select the objects within the current drawing to extract from or select the drawings or folders to extract data from. The active drawing is automatically added to the list. Don’t miss out on the Settings (lower right corner), which provides additional options with how to deal with xrefs and whether the extraction is model space only or it includes the paper space layouts.
Page #3 – Select the objects to extract data from. Its important to note that blocks with attributes are not the only object data that can be extracted. Any object and its properties can be extracted from the drawing, hence why its called Data Extraction and not Attribute Extraction. Have a collection of circles representing holes that you’d like the x,y coordinates? no problem, use this same wizard.
Within the Data Extraction Wizard, any page, right-clicking in the dialog provides options to Check All or Uncheck All making it quick to select the properties desired. Two filters towards the bottom of the dialog provide quick filters to narrow the amount of objects to select from. Display blocks with attributes only limits the selection to just blocks with attributes… doesn’t matter if the block has one or fifty attributes, it’ll show in the list. Display objects currently in-use only limits the list to objects existing in the drawing. Display all object types provides the option to just show blocks.
The Display Name can be adjusted to override the name of the object. For example, if you are extracting the center points of circles you could adjust the display name from Circle to Hole to better describe what the object represents.
Now that the objects are selected you need to set the properties you wish to extract. This can be any of the objects properties or any block attribute. Use the Category filter to reduce the listing, making it easier to find the properties you want to extract. As with the objects you can adjust the Display Name to better describe the property you are including.
A preview of the extracted data comes next (page 5), but more than just previewing the data can be refined as well
- At any point click Full Preview to see a complete listing of all the objects and their properties being extracted.
- Clicking the column header sorts the data ascending or descending, if its in the wrong order just click it again to sort the opposite direction.
- For more sorting options select Sort Column Options, in which you can set multiple columns to sort and the sort priority.
- drag-and-drop columns to reorder, right-click the column header to rename or hide the column
- right-click the column header to add a Total Footer to SUM, AVERAGE, MIN or MAX of the column
- Use the three toggles to show / hide the count and/or name columns and to combine identical rows. Combing identical rows is required if you are after the total quantities of the object.
The above data is refined to hide the Name column (only one block is being extracted, no need to show the name), its sorted by manufacturer, Count was renamed QTY, and a SUM total was added to the Count…
Now that the objects and their properties have been selected and you refined the data as desired you need to set how you want to output the results. The options are to insert into the drawing as a table and to output to an external file. With external files the data can be exported to Excel (.xls), Comma-delimited text (.csv), Access Database (.mdb) or to a text file (.txt). The extracted data to an external file is not “live” and will not automatically update with changes to the drawing.
Step 7 is optional and will only be presented IF you are inserting the extracted data into the drawing as a Table. This page is to configure the table. The result is an AutoCAD Table so the style and other table properties can be adjusted after insertion.
Finally, the last step… confirmation the process is complete. Select Finish to complete the process, the table will be inserted and data will be exported to the external file
Awesome! It might seem like a lot of steps but they aren’t difficult and once you’ve completed the process a few times you’ll breeze right through it.
But now what happens if the drawing changes?
The inserted table is managed by a data link, meaning if the drawing changes impact the data in the table you can update the data link – updating the extracted data. Two options: #1 right-click the data link icon in the status bar or #2 right-click the table inserted into the drawing
Here’s the process….
Featured Image “Building Blocks” by Eran Sandler