You can choose from several geoprocessing tools and data loaders to load CAD data into a geodatabase. Many of them are the same tools you might use with native ArcGIS feature data stored in shapefiles and geodatabases. Although different scenarios require different tools and strategies, workflows for loading CAD data follow a common ETL (extract, transform, and load) pattern.
The following sections discuss the tools and ETL strategies you can use to load CAD data into a geodatabase.
Extracting CAD features
Extracting CAD features is accomplished by creating a selection or by defining an SQL query that filters the geometry by drawing layer, color or line type, or other property attributes.
Map documents
In a map (.mxd) document, the best practice is to use Query Builder and save the query with the feature layer. You can use the Identify window to determine which drawing layers or other CAD attributes uniquely distinguish the CAD features you want to load. The advantage of working in a map document is that you can visually confirm your results before processing the data.
ModelBuilder
In ModelBuilder, a common technique is to use the Feature Class To Feature Class tool as the first tool in the workflow. This tool uses an SQL expression input parameter that you can store with the model or type at runtime. You can also use Query Builder to help you build and verify the expression.
Transforming CAD data
In ArcGIS Desktop, you are never working directly with actual CAD data. CAD features are virtual ArcGIS feature classes that have been translated on the fly from data in the source file. As a result, you can use out-of-the-box geoprocessing tools and common editing techniques to modify and clean up the data before loading it into your production geodatabase. This offers a distinct advantage over traditional ETL methods because CAD data is processed inside a geodatabase as native ArcGIS features.
Geoprocessing tools perform specific tasks such as editing or generating new geometry. In the context of working with CAD data, the tools can be divided into three categories: those that process geometry and fields, those that convert CAD annotation, and those that load data into existing feature classes.
Staging data with a map document
A map (.mxd) document can serve as a temporary workspace for processing and loading CAD data or for debugging geoprocessing models. For ad-hoc workflows, you can use the default geodatabase as a staging area before loading the data into your production geodatabase. ArcMap provides quick access to several tools that open with preconfigured defaults that work well for this purpose.
To use them, right-click the CAD feature layer in the table of contents. The shortcut menu displays the following choices based on the type of CAD feature class you have selected.
- Convert CAD Feature Layer opens the Copy Features tool. If the input layer contains a selection, only the selected features are loaded.
- Convert CAD Feature Dataset opens the CAD To Geodatabase tool. This is a bulk loader that loads all CAD feature classes derived from the same CAD dataset.
- Convert to Geodatabase Annotation opens the Import CAD Annotation tool. This choice is available only when you select a CAD annotation feature layer.
Performing bulk edits
Once you have loaded CAD data into an appropriate feature class, modifying it follows a typical editing workflow. You can perform these edits manually in an edit session or you can use geoprocessing tools from the Editing toolbox and bulk edit the data. For complex iterative workflows, consider using ModelBuilder to organize and debug your transformation workflow.
It is not uncommon for CAD data to require some level of cleanup. Poorly created CAD data can contain numerous overshoots and undershoots that make the data unusable for creating a valid topology. These errors can be corrected using geoprocessing tools such as Extend Line, Trim Line, and Snap.
To learn more about geoprocessing tools for editing, see An Overview of the Editing toolbox
Fields
By default, geoprocessing tools load the input attribute fields that are set to be visible. In some scenarios, this may load the full collection of CAD attribute fields. These fields contain property values for the CAD drawing's geometry or annotation, layer information, document metadata, and user-created attributes. Many of them have no importance to a GIS and can be deleted at any time.
The most efficient way to delete several fields at one time is to use the Delete Field tool. The only fields you need to consider keeping are those you intend to load as feature attributes or those you need for filtering criteria.
To learn more about geoprocessing tools for managing fields, see An overview of the Fields toolset
Creating polygons and other geometry
AutoCAD and MicroStation files do not support a rules-based polygonal object that is equivalent to the polygon feature class in ArcGIS. Instead, polygons are inferred from closed polylines. In ArcGIS Desktop, all closed polylines are displayed in the CAD polygon feature class. If, however, the CAD drawing contains fully enclosed areas constructed with line segments, you can use them to generate polygons with the Feature To Polygon tool.
Complex workflows
Other, more complex scenarios may require a series of tools that transform the data in a stepwise pattern. For example, consider the following strategy to generate interior office space polygons from a CAD floor plan drawing:
- Explode all polylines with the Split Line At Vertices tool.
- Process the results with the Make Feature Layer tool using an SQL expression that selects only the lines greater than 0.5 feet.
- Next, use the Extend Line tool to create enclosed areas from the remaining geometry that is likely to be the interior office spaces.
- Finally, create polygon features with the Feature To Polygon tool.
The results of this workflow can then be added to a map document and edited using manual methods to perform any final corrections such as removing unwanted polygons, planarizing and splitting vertices, and other cleanup operations.
To learn more about geoprocessing tools that transform features from one geometry type to another or verify correctness, see An overview of the Features toolset
Loading data into a geodatabase
Once you are confident the quality of the data meets the requirements of your production geodatabase, you can choose from several tools to load the data. If you are automating the workflow with a geoprocessing model, you can use the Append tool. This tool includes controls to test, filter, and map attribute field schema to the destination feature class. If you are loading data from multiple CAD source files, you can use the Merge tool to combine them into a single feature class before using the Append tool.
To learn more about geoprocessing tools that perform general data management operations, see An overview of the General toolset
Data loaders
You can also choose from two data loaders that generate results similar to the Append tool. Data loaders are wizards that you run interactively. They use Query Builder to limit what is loaded, and they include a tabular interface for mapping input fields to their corresponding fields in the target feature class.
- Object Loader runs within ArcMap during an edit session. You can configure it to use the validation rules defined by the target feature class, as well as snap the data to coordinates. The tool also allows you to undo the changes after the data is loaded.
- Simple Data Loader runs in a Catalog window. This loader does not perform any validation, nor can you undo the changes it makes to the target feature class.
To learn more about data loaders, see About loading data into existing feature classes