Export To CAD (Conversion)

Summary

Exports features to new or existing CAD files based on one or more input feature layers or feature classes.

The geometry, feature attributes, and coordinates system of ArcGIS feature layers will be included when outputting to AutoCAD .dwg or .dxf files. This GIS data can be used with the ArcGIS for AutoCAD plug-in to AutoCAD. If you do not have the plug-in, you can access the output geometry as CAD entities.

Usage

  • This tool creates, or appends to existing, .dwg, .dxf, or .dgn CAD files.

  • This tool will accept ArcGIS-supported point, polyline, polygon, annotation, or multipatch feature classes or their feature layers including those from BIM or CAD feature classes.

  • When the target CAD file has an associated .prj file including any applicable universal .prj files, the coordinates of the output features will be projected to the coordinates of the target CAD file.

  • When the target CAD file has an associated .wld file including any applicable universal .wld files, the coordinates of the output features will be transformed according to the coordinate offset defined for the output CAD file in the applicable .wld file.

  • By default, the tool creates a CAD layer in the CAD file using the input feature layer name as the new CAD layer name for each input feature class or feature layer. The default output CAD layer can be overridden by valid values of input features with a field with a name or alias of Layer or Level.

  • By default, the tool generates output CAD entity geometries most analogous to the input feature geometry. Output entity types can be overridden by valid values in a field with a name or alias of CADType in the feature attributes of the input feature. For example, the default entity type for exporting feature annotation is TEXT. However, if the output features have a field named CADType with field values of POINT, CAD point entities will be generated in the CAD file rather than the TEXT field. Not all entity CAD entity types are supported for output features.

  • By default, output AutoCAD DWG or DXF formatted files will generate attributed ArcGIS feature classes in the .dwg or .dxf files that are supported by both ArcGIS and the ArcGIS for AutoCAD plug-in to AutoCAD. The spatial reference of the exported feature data will be written to the output CAD files.

  • CAD seed files are used to populate the output CAD drawings with blocks, cells, layers, models, and layer symbology according to your CAD standards. Using seed files allows you to reference layers and symbols by name to override the default output by including valid values in key-named fields of the output feature data. For example, you can include valid values in fields with a name or alias of Layer to control where CAD entities are created in the output CAD files.

  • To add key-named CAD fields to the input feature class, use the Add Field tool. To add multiple fields at one time by functional category, use the Add CAD Fields tool.

  • Input point features with valid values in a field with a name or alias of RefName and a value of INSERT or CELL in a field with a name or alias of CADtype allow you to override the default behavior of creating point entities in the output CAD file. Block insert entities or cells will be generated instead. Attributes of block inserts created in the drawing will populate CAD block attributes with GIS feature attribute information if the block's attribute tag name matches a field name.

  • Input features with valid numeric values in a field with a name or alias of Elevation can be used to set the z-coordinate value of the output CAD entity. If this field is not present, the z-coordinate value of each individual vertex of the input feature is used to produce the output CAD entity. Input 2D line feature layers that contain valid numeric values in a field named Contour will similarly set the z-coordinates of the output CAD line entities.

  • Input features with a valid value in a field with a name or alias of CADType or Entity will convert the input feature's geometry into specific CAD entity types. To learn more about Esri feature and CAD entity relationships, see Supported AutoCAD and Microstation geometry.

  • When exporting to a .dgn file using a seed file with named CAD models, features will be created in the specified CAD model according to valid values in a field with a name or alias of CADModel.

  • Input features with a field with a name or alias of DocPath are used to direct the output to one or more CAD drawing files. If the Ignore Paths in Tables parameter is checked, this field is ignored.

  • Input features with a field with a name or alias of LTScale are used to adjust the line weight in .dgn files.

  • Input features with a field with a name or alias of LineWt are used to adjust the line weight in .dwg files.

Parameters

LabelExplanationData Type
Input Features

A collection of feature classes and feature layers whose spatial reference and geometry will be exported to one or more CAD files. Both the feature geometry and the feature attributes will be added to AutoCAD formatted files.

Feature Layer
Output Type

Specifies the CAD platform and file version that will be used for new output CAD files. Multiple versions of CAD software may share one file format version for multiple releases. The options reflect the file format version, not necessarily the software version that may still use a previous file format version.

  • Microstation DGN fileThe output type will be Microstation DGN.
  • DWG version 2018The output type will be DWG version 2018. This is the default.
  • DWG version 2013The output type will be DWG version 2013.
  • DWG version 2010The output type will be DWG version 2010.
  • DWG version 2007The output type will be DWG version 2007.
  • DWG version 2005The output type will be DWG version 2005.
  • DWG version 2004The output type will be DWG version 2004.
  • DWG version 2000The output type will be DWG version 2000.
  • DWG version 14The output type will be DWG version 14.
  • DXF version 2018The output type will be DXF version 2018.
  • DXF version 2013The output type will be DXF version 2013.
  • DXF version 2010The output type will be DXF version 2010.
  • DXF version 2007The output type will be DXF version 2007.
  • DXF version 2005The output type will be DXF version 2005.
  • DXF version 2004The output type will be DXF version 2004.
  • DXF version 2000The output type will be DXF version 2000.
  • DXF version 14The output type will be DXF version 14.
String
Output File

The path of the output CAD drawing file. This path will be overridden by any valid file paths included as field values in the input feature's field or alias field named DocPath unless the Ignore Paths in Tables parameter is checked.

CAD Drawing Dataset
Ignore Paths in Tables
(Optional)

Specifies whether valid paths included in the DocPath field of input features will be ignored.

  • Checked—Valid paths will be ignored and the output of all entities will be added to the Output File parameter value. This is the default.
  • Unchecked—Valid paths will be used so that each new CAD entity will be written to the file specified by that field value.
Boolean
Append to Existing Files
(Optional)

Specifies whether entities will be appended to an existing output CAD file or CAD files specified by the Output File parameter or any valid file paths contained in DocPath field values according to the Ignore Paths in Tables parameter will be overwritten.

  • Checked—Entities will be appended to an output CAD file if one exists. The existing CAD file content will be retained.
  • Unchecked—If an output CAD file exists, it will be overwritten. This is the default.
Boolean
Seed File
(Optional)

An existing CAD drawing whose contents and document and layer properties will be used as a seed file when output CAD files are created. The CAD platform and format version of the seed file overrides the value specified by the Output Type parameter. If appending to existing CAD files, the seed drawing is ignored.

CAD Drawing Dataset

arcpy.conversion.ExportCAD(in_features, Output_Type, Output_File, {Ignore_FileNames}, {Append_To_Existing}, {Seed_File})
NameExplanationData Type
in_features
[in_features,...]

A collection of feature classes and feature layers whose spatial reference and geometry will be exported to one or more CAD files. Both the feature geometry and the feature attributes will be added to AutoCAD formatted files.

Feature Layer
Output_Type

Specifies the CAD platform and file version that will be used for new output CAD files. Multiple versions of CAD software may share one file format version for multiple releases. The options reflect the file format version, not necessarily the software version that may still use a previous file format version.

  • DGN_V8The output type will be Microstation DGN.
  • DWG_R2018The output type will be DWG version 2018. This is the default.
  • DWG_R2013The output type will be DWG version 2013.
  • DWG_R2010The output type will be DWG version 2010.
  • DWG_R2007The output type will be DWG version 2007.
  • DWG_R2005The output type will be DWG version 2005.
  • DWG_R2004The output type will be DWG version 2004.
  • DWG_R2000The output type will be DWG version 2000.
  • DWG_R14The output type will be DWG version 14.
  • DXF_R2018The output type will be DXF version 2018.
  • DXF_R2013The output type will be DXF version 2013.
  • DXF_R2010The output type will be DXF version 2010.
  • DXF_R2007The output type will be DXF version 2007.
  • DXF_R2005The output type will be DXF version 2005.
  • DXF_R2004The output type will be DXF version 2004.
  • DXF_R2000The output type will be DXF version 2000.
  • DXF_R14The output type will be DXF version 14.
String
Output_File

The path of the output CAD drawing file. This path will be overridden by any valid file paths included as field values in the input feature's field or alias field named DocPath unless the Ignore_FileNames parameter is set to Ignore_Filenames_in_Tables.

CAD Drawing Dataset
Ignore_FileNames
(Optional)

Specifies whether valid paths included in the DocPath field of input features will be ignored.

  • Ignore_Filenames_in_TablesValid paths will be ignored and the output of all entities will be added to the Output_File parameter value. This is the default.
  • Use_Filenames_in_TablesValid paths will be used so that each new CAD entity will be written to the file specified by that field value.
Boolean
Append_To_Existing
(Optional)

Specifies whether the output will be appended to an existing CAD file. This allows you to add information to a CAD file on disk.

  • Append_To_Existing_FilesEntities will be appended to an output CAD file if one exists. The existing CAD file content will be retained.
  • Overwrite_Existing_FilesIf an output CAD file exists, it will be overwritten. This is the default.
Boolean
Seed_File
(Optional)

An existing CAD drawing whose contents and document and layer properties will be used as a seed file when output CAD files are created. The CAD platform and format version of the seed file overrides the value specified by the Output_Type parameter. If appending to existing CAD files, the seed drawing is ignored.

CAD Drawing Dataset

Code sample

ExportCAD example (stand-alone script)

The following stand-alone script demonstrates how to use the ExportCAD function.

# Description: Create an AutoCAD DWG

# Import system modules
import arcpy

# Set local variables
in_features = "C:/data/EditorTutorial.gdb/StudyArea/Buildings"
output_type = "DWG_R2010"
output_file = "c:/data/Buildings.dwg"

# Process: Export to CAD
arcpy.conversion.ExportCAD(in_features, output_type, output_file, 
                           "USE_FILENAMES_IN_TABLES", "OVERWRITE_EXISTING_FILES")

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics