Summary
Reads a CAD dataset and creates feature classes of the drawing. The feature classes are written to a geodatabase feature dataset.
Usage
This tool creates a new feature dataset in an existing geodatabase, which is added as a group layer in the map.
The input features must be a CAD file. The CAD file will contain all the available homogenous geometries.
The input parameter will accept CAD data from multiple formats (DWG, DXF, and DGN) in one operation.
If a DWG is used as input it may contain additional CAD-defined feature classes that conform to the Esri specification document Mapping Specification for CAD. These are subsets of the original homogenous geometries with entity-linked attributes that also import to the geodatabase as feature attributes.
Feature class names must be unique for the entire geodatabase or the tool will fail.
All inputs are combined into a single output CAD dataset, which will contain the standard point, line, and polygon feature classes, in addition to any CAD-defined feature classes that may exist.
If a projection file exists for the input CAD file, it will automatically populate the spatial_reference parameter with the projection information. If multiple CAD files are used as inputs, the spatial_reference will be taken from the first CAD file with valid projection information.
If a universal projection (esri_cad.prj) file exists in the directory, the projection information will be taken from the universal projection file if a coordinate system is not defined for the first CAD file.
If a world file exists for the input CAD file, it will automatically perform the transformation.
If a universal world (esri_cad.wld) file exists in the directory, the transformation will be applied to each CAD dataset in the list that does not have a companion world file.
If a DGN file has multiple models, be sure the first model has the largest domain. This tool calculates the domain for the entire DGN file from the first model. If this is not the case, be sure to expand the domain in your first model to be large enough so all will fit.
Should you only require a single feature class from the CAD feature classes, use a geoprocessing tool such as Feature Class To Feature Class.
Syntax
CADToGeodatabase(input_cad_datasets, out_gdb_path, out_dataset_name, reference_scale, {spatial_reference})
Parameter | Explanation | Data Type |
input_cad_datasets [CAD drawing dataset,...] | The collection of CAD files to convert to geodatabase features. | CAD Drawing Dataset |
out_gdb_path | The geodatabase where the output feature dataset will be created. This geodatabase must already exist. | Workspace |
out_dataset_name | The name of the feature dataset to be created. | String |
reference_scale |
This parameter is not needed for this tool as CAD annotation is treated as points in ArcGIS Pro. | Double |
spatial_reference (Optional) | The spatial reference of the output feature dataset. If you wish to control other aspects of the spatial reference, such as the xy, z, m domains, resolutions, and tolerances, set the appropriate geoprocessing environments. | Spatial Reference |
Derived Output
Name | Explanation | Data Type |
out_dataset | The output geodatabase feature dataset containing the new feature classes. | Feature Dataset |
Code sample
The following Python script demonstrates how to use the CADToGeodatabase function in a stand-alone script.
# Name: CADtoGeodatabase.py
# Description: Create a feature dataset
# Import system modules
import arcpy
# Set workspace
arcpy.env.workspace = "C:/data"
# Set local variables
input_cad_dataset = "C:/data/City.DWG"
out_gdb_path = "C:/data/HabitatAnalysis.gdb"
out_dataset_name = "analysisresults"
reference_scale = "1000"
spatial_reference = "NAD_1983_StatePlane_California_VI_FIPS_0406_Feet"
# Create a file geodatabase for the feature dataset
arcpy.CreateFileGDB_management("C:/data", "HabitatAnalysis.gdb")
# Execute CreateFeaturedataset
arcpy.CADToGeodatabase_conversion(input_cad_dataset, out_gdb_path,
out_dataset_name, reference_scale)
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes