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:
- An AutoCAD seed file containing a block definition with attributes that will store the attribute values
- An ArcGIS point feature class with the fields CADType and RefName added to the attribute table
- Field names in the input feature class attribute table that match the block attribute tag names defined with the AutoCAD block definition
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".
- Right-click the feature layer in the table of contents, and click Open Attribute Table.
- Click the General Tabular Operations button on the attribute table menu bar, and click Add Field to open the dialog box.
- Type the field name CADType in the Name text box.
- Click the Type drop-down arrow, and click Text to assign the data type.
- Accept the default field length of 50.
- Click OK to close the dialog box and create the field.
- Right-click the CADType field name in the attribute table, and click Field Calculator on the shortcut menu.
- Type "INSERT" (including the double quotes) in the Expression text box.
- 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.
- Right-click the feature layer in the table of contents, and click Open Attribute Table.
- Click the General Tabular Operations button on the attribute table menu bar, and click Add Field to open the dialog box.
- Type the field name RefName in the Name text box.
- Click the Type drop-down arrow, and click Text to assign the data type.
- Accept the default field length of 50.
- Click OK to close the dialog box and create the field.
- Right-click the RefName field name in the attribute table, and click Field Calculator on the shortcut menu.
- Clear any existing values in the Expression text box.
- 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).
- Click OK to run the tool.
The field RefName now displays the value MyBlock for all records.
Run the Export To CAD tool
- Using the Search window , find and open the Export To CAD tool.
- Drag the feature layer containing the new fields from the table of contents to the Input Features text box.
- Click the Output Type drop-down arrow, and choose an AutoCAD DWG format.
- Click the Output File browse button , navigate to a folder, type a name for the new CAD file, and click Save.
- Or, accept the default path and filename.
- Drag the AutoCAD seed file containing the block definition for MyBlock from the Catalog window to the Seed File text box.
- 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.