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.
This tool exports annotation feature classes to CAD files as text. Conversely, the Import CAD Annotation tool creates annotation feature classes from text in CAD files.
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 vertices 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
ExportCAD_conversion (in_features, Output_Type, Output_File, {Ignore_FileNames}, {Append_To_Existing}, {Seed_File})
Parameter | Explanation | Data 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.
| 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) | Allows the function to 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.
| Boolean |
Append_To_Existing (Optional) | Allows the output to append to an existing CAD file. This allows you to add information to a CAD file on disk.
| 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 theExportToCAD 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")
Environments
Licensing information
- ArcGIS Desktop Basic: Yes
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes