This workflow demonstrates how to export features to a specific CAD layer and layer color using reserved CAD fields Layer and LyrColor.
Add reserved CAD fields to the attribute table
Adding the Layer field
The Layer field specifies the CAD layer that is created for each feature entity. Use Field Calculator to specify the target layer name. You can specify the same layer for all features or direct features to specific layers.
- 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 Layer in the Name text box.
- Click the Type 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 Layer field name in the attribute table and click Field Calculator on the shortcut menu.
- Type "MyLayer" (including the double quotes) in the Expression text box.
- Click OK to run the tool.
The Layer field now displays the value MyLayer for all records.
Adding the LyrColor field
The LyrColor field specifies the color for the layer. Use Field Calculator to specify the color number.
- 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 LyrColor in the Name text box.
- Click the Type arrow and click Short Integer to assign the data type.
- Click OK to close the dialog box and create the field.
- Right-click the LyrColor 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 number 1 in the Expression text box.
- Click OK to run the tool.
The LyrColor field now displays the value 1 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 that contains the reserved CAD fields from the table of contents to the Input Features text box.
- Click the Output Type arrow and choose a CAD format.
- Click the Output File browse button , navigate to a folder, type a name, then click Save.
- Or accept the default path and file name.
- Click OK to run the tool and generate the CAD file.
Open the Layer Properties dialog box and click the Drawing Layers tab to verify your results with the CAD feature layer in the newly created CAD dataset.