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, as defined by the Mapping Specification for CAD. This nongraphic data is recognized by ArcGIS for Desktop and it can be edited in the AutoCAD application (version 2007 or higher) using the Esri plug-in ArcGIS for AutoCAD.
Output to DWG/DXF (version 2007 or higher) writes feature class schema for each feature class to the drawing’s named object dictionary using xrecords, as defined by the Mapping Specification for CAD. This nongraphic data is recognized by ArcGIS for 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 higher) exports feature attributes as entity-linked attributes to the drawing's extension dictionary referenced by the entity, as defined by the Mapping Specification for CAD. This nongraphic data is recognized by ArcGIS for 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 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. Types include DGN_V8, DWG_R14, DWG_R2000, DWG_R2004, DWG_R2005, DWG_R2007, DWG_R2010, DXF_R14, DXF_R2000, DXF_R2004, DXF_R2005, DXF_R2007, and DXF_R2010. | 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 lets you 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
# Name: ExportToCAD.py
# Description: Create an AutoCAD DWG
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "C:/data"
# Set local variables
in_features = "C:/data/EditorTutorial.gdb/StudyArea/Buildings"
output_type = "DWG_R2010"
output_file = "c:/data/Buildings.dwg"
try:
# Process: Export to CAD
arcpy.ExportCAD_conversion(in_features, output_type, output_file, "USE_FILENAMES_IN_TABLES", "OVERWRITE_EXISTING_FILES", "")
except:
# If an error occurs while running a tool print the message
print arcpy.GetMessages()
Environments
Licensing information
- ArcGIS for Desktop Basic: Yes
- ArcGIS for Desktop Standard: Yes
- ArcGIS for Desktop Advanced: Yes