Label | Explanation | Data 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 choices specify the file format version, not necessarily the software version that may still use a previous file format version.
| 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.
| 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.
| 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 |
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.
Point, polyline, polygon, annotation, and multipatch feature classes and feature layers are valid inputs to this tool.
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.
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 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 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
arcpy.conversion.ExportCAD(in_features, Output_Type, Output_File, {Ignore_FileNames}, {Append_To_Existing}, {Seed_File})
Name | Explanation | Data 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 choices specify the file format version, not necessarily the software version that may still use a previous file format version.
| 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.
| 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.
| 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
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")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes