Using ModelBuilder to export data to CAD
This workflow demonstrates how you can use ModelBuilder to automate a workflow that utilizes both the Make Feature Layer tool and the Export To CAD tool.
This example builds a definition query to export a subset of features to a CAD file. The input feature class name is Parcels. Substitute the name of your feature class.
Start ArcMap and add data
- Start ArcMap by clicking Start > All Programs > ArcGIS > ArcMap 10.1.
- Click OK on the Getting Starteddialog box to accept the default geodatabase for this map.
- Add the Parcels feature class to ArcMap.
Create a toolbox and a Model
- In the Catalog window, navigate to the folder or geodatabase where you want the toolbox to be saved.
- Right-click the folder or geodatabase, and click New > Toolbox .
- Right-click the toolbox, click Rename, and type MyToolbox.
- Right-click the toolbox you created, and click New > Model.
This creates the model and opens ModelBuilder.
Add the Make Feature Layer tool
- Using the Search window , find the Make Feature Layer tool, and drag it onto the canvas.
- Double-click Make Feature Layer to open the dialog box.
- Click the Input Features drop-down arrow, and choose the Parcels feature class.
- Accept the default Output Layer name Parcels_Layer.
- Click the Expression SQL button to open Query Builder.
- Clear any existing values in the Expression text box.
-
Double-click a field name in the Fields list that contains the values you want to use in your query. This adds the field name to the Expression text box.
For example [proptype].
- Click an operator button such as equal to add the operator to the expression.
- Click the Get Unique Values button.
-
Double-click an attribute value from the list that you want use as your selection criteria.
For example, the expression "proptype" = 'residential' selects only the features with an attribute value that equals residential in the proptype field. This completes the SQL statement.
- Click OK to close Query Builder and add the SQL statement to the Expression text box.
- Click OK to close the tool dialog box.
Add the Export to CAD tool
- Using the Search window , find the Export To CAD tool, and drag it onto the canvas.
- Click the Connect button on the toolbar.
- Click Parcels_Layer, click Export to CAD, then click Input Features on the shortcut menu.
- Double-click Export to CAD to open the dialog box.
-
Click the Input Feature drop-down arrow, and choose the variable Parcels_Layer.
Variables are identified with blue circular arrows.
- Click the Output Type drop-down arrow, and choose a CAD format.
-
Click the Output File browse button , navigate to a folder, type the filename, and click Save.
- Or accept the default path and filename.
- Click OK to close the dialog box.
Run your model
Your model should contain components similar the example below:
- Click the Run button from the toolbar to run the model.
- Drag the newly created CAD dataset into ArcMap to verify your results.
To further automate this process, you can expose parameters in the model to prompt you for input. Alternatively, you can use Python to perform this workflow as a script.