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

Syntax

CADtoGeodatabase_conversion (input_cad_datasets, out_gdb_path, out_dataset_name, reference_scale, {spatial_reference})
ParameterExplanationData 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)

Environments

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

11/14/2011