Extracting Block Attribute Data (Advanced)

You can extract attribute information from a drawing and create a separate text file for use with database software. This feature is useful for creating parts lists with information already entered in the drawing database. Extracting attribute information does not affect the drawing.

To create a parts list

To extract attribute information, you first create an attribute extraction template file using any text processor, then generate the attribute extraction file using AutoCAD LT, and, finally, open the attribute extraction file in a database application.

Note: If you plan to extract the attribute information to a DXF (drawing interchange format) file, it is not necessary to first create an attribute extraction template file.

Creating an Attribute Extraction Template File

Before you extract attribute information, you must create an ASCII template file to instruct AutoCAD LT how to structure the file that will contain the extracted attribute information. The template file contains information about the tag name, data type, field length, and number of decimal places associated with the information you want to extract. The illustration and table show an example of the type of information you're likely to extract, including block name, manufacturer, model number, and cost.

Example of template file information

Field (C)haracter or
(N)umeric data
Maximum field
length
Decimal
places
Block name C 040 000
Manufacturer C 006 000
Model C 015 000
Cost N 006 002

You can create any number of template files, depending on how you'll use the data. Each line of a template file specifies one field to be written in the attribute extraction file. The following table describes what you can specify. You may use some or all of these fields.

Follow these additional guidelines:

Creating an Attribute Extraction File

After creating a template file, you can extract the attribute information using one of the following formats:

The CDF format produces a file containing one record for each block reference in a drawing. A comma separates the fields of each record, and single quotation marks enclose the character fields. Some database applications can read this format directly.

The SDF format also produces a file containing one record for each block reference in a drawing. The fields of each record have a fixed width and employ neither field separators nor character-string delimiters. The dBASE III Copy . . . SDF operation also produces SDI-format files. The Append From . . . SDF operation can read a file in dBASE IV format, which user programs written in FORTRAN can easily process.

The DXF format option produces a subset of the drawing interchange file format containing only block reference, attribute, and end-of-sequence objects. This option requires no attribute extraction template. The file extension .dxx distinguishes an extraction file in DXF format from normal DXF files.

Using the Attribute Extraction File

The attribute extraction file lists values and other information for the attribute tags you specified in the template file.

If you specified a CDF format using the same template file shown under Creating an Attribute Extraction File the output might appear as follows.

'DESK', 120.0, 49.5, 'ACME INDUST.', '51-793W', 379.95
'CHAIR', 122.0, 47.0, 'ACME INDUST.', '34-902A', 199.95
'DESK', -77.2, 40.0, 'TOP DRAWER INC.', 'X-52-44',249.95

If you specified an SDF format using the sample template, the file might be similar to the following example.

(NAME) (X) (Y) (SUPPLIER) (MODEL) (PRICE)
DESK 120.0 49.5 ACME INDUST. 51-793W 379.95
CHAIR 122.0 47.0 ACME INDUST. 34-902A 199.95
DESK -77.2 40.0 TOP DRAWER INC. X-52-44 249.95

The order of the fields corresponds to the order of the fields in the template files. You can use these files in other applications, such as spreadsheets, and you can sort and manipulate the data as needed. For example, you can open an attribute extraction file in Microsoft Excel in which you can specify a separate column for each field. See your spreadsheet program's documentation for information about how to use data from other applications. If you open the file in Notepad or another Windows text processor, you can paste the information back into AutoCAD LT as text.