CAD to Geodatabase (Conversion)
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. When run from ArcMap the results are added as a group layer.
-
This tool creates feature class annotation from CAD text.
-
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, polygon, annotation feature classes in addition to any CAD-defined feature classes that may exist.
-
This tool only outputs a dataset to any geodatabase along with ArcSDE instances.
-
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.
-
Choose a reference scale that is roughly equal to the scale at which the annotation will normally be displayed.
-
Should you only require a single feature class from the CAD feature classes, then use a geoprocessing tool, such as Feature Class To Feature Class.
Syntax
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 ArcSDE, file, or personal geodatabase where the Output Feature Dataset will be created. The target geodatabase must already exist. | Workspace |
out_dataset_name |
The name of the feature dataset to be created. | String |
reference_scale |
Enter the scale to use as a reference for the annotation. This sets the scale to which all symbol and text sizes in the annotation will be made relative. | Double |
spatial_reference (Optional) |
The spatial reference of the output feature dataset. If you wish to control other aspects of the spatial reference (i.e., the xy, z, m domains, resolutions, tolerances), use the relevant environments. | Spatial Reference |
Code Sample
#Name: CadtoGeodatabase.py # Description: Create a feature dataset # Author: ESRI # Import system modules import arcpy from arcpy import env # Set workspace 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 FileGDB for the fds arcpy.CreateFileGDB_management("C:/data", "HabitatAnalysis.gdb") # Execute CreateFeaturedataset arcpy.CadToGeodatabase_conversion(input_cad_dataset, out_gdb_path, out_dataset_name, reference_scale)