Exporting attribute values to AutoCAD block attributes

This workflow demonstrates how to export feature attributes to AutoCAD block attributes using reserved CAD fields CADType and RefName, and a seed file.

This workflow requires the following:

The resulting DWG file will contain a block reference for each point feature that is in the input feature attribute table. Each block reference will contain the feature attributes for the field names that correspond to a matching block attribute tag name.

Prepare the seed file

The AutoCAD seed file must contain a block definition for each block reference you specify with the RefName field. You can reference the same block definition for all features or direct features to specific blocks defined in the seed file. If you specify a block definition that does not exist, the Export to CAD tool will insert a generic block reference defined as a circle one unit in diameter, with no attributes.

Add reserved CAD fields to the attribute table

Adding the CADType field

The CADType field specifies the type of CAD entity to be generated. You will use the Field Calculator to specify the keyword "INSERT".

Steps:
  1. Right-click the feature layer in the table of contents, and click Open Attribute Table.
  2. Click the General Tabular Operations button Table Options on the attribute table menu bar, and click Add Field to open the dialog box.
  3. Type the field name CADType in the Name text box.
  4. Click the Type drop-down arrow, and click Text to assign the data type.
  5. Accept the default field length of 50.
  6. Click OK to close the dialog box and create the field.
  7. Right-click the CADType field name in the attribute table, and click Field Calculator Calculator on the shortcut menu.
  8. Type "INSERT" (including the double quotes) in the Expression text box.
  9. Click OK to run the tool.

    The CADType field now displays the value INSERT for all records.

Add the RefName field

The RefName field specifies the name of the AutoCAD block definition that will be inserted in the CAD file for each feature entity. You will use the Field Calculator to specify the keyword "MyBlock". Substitute a block name that exists in your AutoCAD seed file.

Steps:
  1. Right-click the feature layer in the table of contents, and click Open Attribute Table.
  2. Click the General Tabular Operations button Table Options on the attribute table menu bar, and click Add Field to open the dialog box.
  3. Type the field name RefName in the Name text box.
  4. Click the Type drop-down arrow, and click Text to assign the data type.
  5. Accept the default field length of 50.
  6. Click OK to close the dialog box and create the field.
  7. Right-click the RefName field name in the attribute table, and click Field Calculator Calculator on the shortcut menu.
  8. Clear any existing values in the Expression text box.
  9. Type the name of the block definition that is saved in your AutoCAD seed file in the Expression text box. For example: "MyBlock" (including the double quotes).
  10. Click OK to run the tool.

    The field RefName now displays the value MyBlock for all records.

Run the Export To CAD tool

Steps:
  1. Using the Search window Search, find and open the Export To CAD tool.
  2. Drag the feature layer containing the new fields from the table of contents to the Input Features text box.
  3. Click the Output Type drop-down arrow, and choose an AutoCAD DWG format.
  4. Click the Output File browse button Browse, navigate to a folder, type a name for the new CAD file, and click Save.
    • Or, accept the default path and filename.
  5. Drag the AutoCAD seed file containing the block definition for MyBlock from the Catalog window to the Seed File text box.
  6. Click OK to run the tool.

Open the attribute table for the CAD point feature layer in the newly created CAD dataset to verify your results.

Related Topics

12/16/2013