Export to CAD (Conversion)

Summary

Creates one or more CAD drawings based on the values contained in one or more input feature classes or feature layers and supporting tables.

Usage

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

  • Feature classes, feature layers, and shapefiles are valid inputs to this tool.

  • Default output creates a drawing layer for each input feature class or layer unless otherwise specified with a seed file and/or key named fields.

  • Default output generates entities using the default properties of the output CAD file format unless otherwise specified with a seed file and/or key named fields.

  • Output to DWG/DXF format writes the coordinate system to the drawing's named object dictionary using a well-known text (WKT) string. This nongraphic data is recognized by ArcGIS Desktop and it can be edited in the AutoCAD application (version 2007 or later) using the Esri plug-in ArcGIS for AutoCAD.

  • Output to DWG/DXF (version 2007 or later) writes feature class schema for each feature class to the drawing’s named object dictionary using xrecords. This nongraphic data is recognized by ArcGIS Desktop and it can be edited in the AutoCAD application using the Esri plug-in ArcGIS for AutoCAD.

  • Output to DWG/DXF (version 2007 or later) exports feature attributes as entity-linked attributes to the drawing's extension dictionary referenced by the entity. This nongraphic data is recognized by ArcGIS Desktop and it can be edited in the AutoCAD application using the Esri plug-in ArcGIS for AutoCAD.

  • This tool will not export coverage annotation to any CAD format.

  • Seed files and key named fields can be used to control layers, graphic properties such as color, and AutoCAD block definitions in the output CAD files.

  • To add key named 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.

  • The RefName field in the input feature class specifies which seed file block or cell names to use. Attribute tag elements defined for an AutoCAD block definition are populated with attribute information if the tag name matches a field name.

  • The Elevation field in the input feature class specifies 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.

  • The CadType or Entity 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.

  • The DocPath field in the input feature class is used to direct the output to one or more CAD drawing files. If the parameter Ignore Paths in Tables is checked (enabled) on the tool dialog box, this field is ignored.

  • The LTScale field is used to adjust the line weight in DGN files.

  • The LineWt field is used to adjust the line weight in DWG files.

Syntax

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

A collection of feature classes and/or feature layers whose geometry will be exported to one or more CAD files.

Feature Layer
Output_Type

The CAD platform and file version of the output files. This value overrides any Output_Type values contained in the keyname column or alias column CADFile_type.

  • DGN_V8Microstation DGN file
  • DWG_R2018DWG version 2018
  • DWG_R2013DWG version 2013
  • DWG_R2010DWG version 2010
  • DWG_R2007DWG version 2007
  • DWG_R2005DWG version 2005
  • DWG_R2004DWG version 2004
  • DWG_R2000DWG version 2000
  • DWG_R14DWG version 14
  • DXF_R2018DXF version 2018
  • DXF_R2013DXF version 2013
  • DXF_R2010DXF version 2010
  • DXF_R2007DXF version 2007
  • DXF_R2005DXF version 2005
  • DXF_R2004DXF version 2004
  • DXF_R2000DXF version 2000
  • DXF_R14DXF version 14
String
Output_File

The path of the desired output CAD drawing file. This name overrides any drawing name information included in the input features columns or alias columns named DrawingPathName.

CAD Drawing Dataset
Ignore_FileNames
(Optional)

Specifies whether the function will ignore or use the paths in the DrawingPathName. This allows the function to output CAD entities to specific drawings or ignore this and add to one CAD file.

  • Ignore_Filenames_in_TablesThe paths in the document entity fields will be ignored and the output of all entities will be added to a single CAD file.
  • Use_Filenames_in_TablesThe paths in the document entity fields and each entity's path will be used so that each CAD part will be written to a separate file. This is the default.
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_FilesThe output file content will be added to an existing output CAD file. The existing CAD file content will not be lost.
  • Overwrite_Existing_FilesThe output file content will overwrite the existing CAD file content. This is the default.
Boolean
Seed_File
(Optional)

An existing CAD drawing whose contents and document and layer properties will be used for all new output CAD files. 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 tool.

# 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