Export to CAD (Conversion)

Summary

Exports features to new or existing CAD files based on one or more input feature layers or feature classes and supporting tables. Spatial reference, geometry, and feature attributes will be included when outputting to AutoCAD formatted files.

Usage

  • This tool creates, or appends to existing, DWG, DXF, or DGN CAD files.

  • Point, polyline, polygon, annotation, and multipatch feature classes and feature layers are valid inputs to this tool.

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

  • By default, the tool creates a CAD layer in the CAD file using the feature layer name as the new CAD layer name for each input feature class or feature layer. This is the case unless the CAD layer information is overridden by feature attribute values in a field named or aliased Layer or Level in the feature attributes.

  • By default, the tool generates CAD entity geometries most analogous to the output feature geometry. This is the case unless the geometries are overridden by valid values in a field named or aliased CADType in the feature attributes of the output feature. For example, the default entity type for exporting feature annotation is TEXT entities. 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.

  • 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 desktop 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 can be used to prepopulate the output CAD drawings with blocks, cells, layers, and layer symbology according to your CAD standards. Using seed files allows you to reference layers and symbols by name when overriding the default output when key-named field values are included in the output feature data. For example, you can include valid values in fields named or aliased Layer or RefName to control how 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 named or aliased RefName and a value of INSERT or CELL in a field named or aliased CADtype will 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.

  • Output features with valid numeric values in a field named or aliased 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.

  • Output features with a CadType or Entity named or aliased field in the input feature class is used to convert the input features into specific CAD entities. To learn more about Esri feature and CAD entity relationships, see Supported AutoCAD and Microstation geometry.

  • Output features with a DocPath named or aliased field in the input feature class is 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.

  • Output features with a LTScale named or aliased field is used to adjust the line weight in .dgn files.

  • Output features with a LineWt named or aliased field is 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 geometry and attributes of features 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 choices specify 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—The 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—The 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 geometry and attributes of features 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 choices specify 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_TablesThe valid 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_TablesThe 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
(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

ExportToCAD example (stand-alone script)

The following stand-alone script demonstrates how to use the ExportToCAD 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.ExportCAD_conversion(in_features, output_type, output_file, 
                           "USE_FILENAMES_IN_TABLES", "OVERWRITE_EXISTING_FILES")

Licensing information

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

Related topics