After you enter the attributes in your drawing, you can extract the information contained in the attributes and use it to generate
When you extract attribute data, AutoCAD creates a text file. You can choose to export the file in either comma-delimited or tab-delimited format. If you have Microsoft Excel or Access installed, you can also export the attribute data in a format compatible with these programs.
|
|
Using attributes is an easy way to combine editable text with graphic symbols without
Here is a portion of the San Francisco Main Library with a typical set of grid symbols. Each symbol contains an attribute similar to the one you created earlier for the room
|
|
In the past,extracting the attribute data from a drawing was an
| Note |
LT does not offer the Attribute Extraction Wizard. Instead, you see the more simplified Attribute Extraction dialog box that offers the file format options (comma- or space-delimited or DXF output), the output filename, and template file options. For LT, the template file is used as an option to filter the attributes. |
{% if main.adsdop %}{% include 'adsenceinline.tpl' %}{% endif %}
In this first exercise, you'll explore the Attribute Extraction Wizard:
Go back to the
Plan
file and choose Tools
Attribute Extraction to start the Attribute Extraction Wizard. In the Select Drawing screen, you can select specific blocks for the attribute data extraction. You can also select drawings other than the current drawing. The default is to select the entire current drawing. The
Click
Click Next to open the Use Template screen. This screen enables you to import settings from an external file. Right now, it's not likely that you have any saved settings available, but in a later screen of the Attribute Extraction Wizard, you will have a chance to save the options you select as a template file that you can import in later Attribute Extraction sessions.
Click Next to open the Select Attributes screen.
Take a moment to study the Select Attributes screen. It is the heart of the extraction process. Here you select the blocks that contain attributes as well as the specific attributes you want to extract. Notice that in the Blocks list box on the left, all the blocks in the drawing are displayed ”not just those that contain
You can obtain some helpful information about your drawing just by looking at this screen. For example, you can find out how many copies of a particular block occur in the drawing by looking at the right column of the Blocks list box.
You can also add an alternate name in the Block Alias column to help better describe the block. An Alias option is also available in the Attributes For Block list box.
Let's continue by selecting specific information for the extraction:
Click the Uncheck All button at the bottom of the Blocks list to clear the check boxes on the left side of the list box.
Scroll down to the bottom of the Blocks list box and select the S-DOOR block name. Notice that the attribute list changes to show values for the selected block.
Click the Uncheck All button at the bottom of the Attributes For Block list.
Scroll down to the bottom of the Attributes For Block list and select all the attribute names. Remember that the attribute
Click Next to open the View Output screen, which displays a listing of the attribute data that you selected in the previous screen. The attribute values are shown in a table, with each block listed as a row and the attributes of the block listed in columns. You can use the horizontal scroll bar at the bottom of the list to view all the
Click the Alternate View button. The list changes so that the selected attribute data are listed individually, with one attribute per row.
Click the Alternate View button again to return to the first view.
The first alternate offers a clearer view of the data. Notice that every door is listed. When any attribute data
Try the following to see how this works:
Click the Back button to return to the Select Attributes screen.
Go to the bottom of the Attributes For Block list and clear the checkmark next to the D-NUMBER attribute. This is the only attribute that changes for each instance of the S-DOOR block, and you are no longer extracting it.
Click Next to return to the View Output screen. Now you see only a single listing for the S-DOOR block.
Because all the data is the same for each selected attribute, the Attribute Extraction Wizard lists the block name once. Notice that under the Count column it also indicates the number of times the block appears in the drawing.
As you can see from the exercises so far, you can use the Attribute Extraction Wizard to quickly view attribute and block data without performing the entire extraction process. You can also copy the data to the Clipboard to save the data on the fly.
Now let's complete the extraction process. First you'll go back and restore the D-NUMBER attribute so you can get a complete listing of the S-DOOR data and then you'll extract the file:
Click the Back button.
In the Attributes For Block list, make sure the D-NUMBER attribute is selected, and click Next to open the View Ouput screen.
Click Next again to open the Save Template screen. You might recall that earlier you had the option to recall a template file. This is where you can save a template file for
|
|
If you prefer the older method of using a template file to determine which attributes to extract, you can do so by using the command-line version of the Attext command. Enter
-Attext
and follow the prompts. Make sure you have a template file ready.
A template file is a simple TXT file that contains the tag name of the attribute you wish to extract, followed by a code indicating the type of value being extracted and the spaces required. For example, a template file containing D-NUMBER C005000 tells AutoCAD to extract the D-NUMBER attribute. The code C005000
|
|
Click Next to open the Export screen. This is where you specify the filename and type of file you want to extract.
Click the File Type drop-down list and take a moment to study the options. Notice that you can save the exported data as comma-delimited text (.csv) and tab-delimited text (.txt). If you have Microsoft Office installed on your computer, you may also see Microsoft Excel (.xls) or Microsoft Access Database f (.mdb). Select the Tab Delimited (*.txt) option.
Click the ellipsis ( ) button to the right of the File Name input box to open the Save As dialog box. Enter Planattribute in the File Name input box.
Using the Save In drop-down list, locate the folder where you are storing your sample files for the exercises in this book, and click Save.
Back in the Export screen, click Finish to return to your drawing.
You now have a file called Planattribute.txt that contains the data you saw earlier in the View Output screen of the Attribute Extraction Wizard. You can import that data into any program that will accept a tab-delimited data file, including database, spreadsheet, and word-processing programs.
In step 6 of the previous exercise, you also had the option to save the file in a CSV, or comma-delimited, format. This format is common to many Microsoft Office products. If you have Microsoft Excel or Access, you can also export files to the native formats of these programs.