ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Export To CAD

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

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})
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. Types include DGN_V8, DWG_R14, DWG_R2000, DWG_R2004, DWG_R2005, DWG_R2007, DWG_R2010, DWG_R2013, DXF_R14, DXF_R2000, DXF_R2004, DXF_R2005, DXF_R2007, DXF_R2010, and DXF_R2013.

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.

  • IGNORE_FILENAMES_IN_TABLES —Ignores the paths in the document entity fields and allows the output of all entities to a single CAD file.
  • USE_FILENAMES_IN_TABLES —Allows the paths in the document entity fields to be used and have each entity's path used so that each CAD part will be written to a separate file. This is the default.
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.

  • APPEND_TO_EXISTING_FILES —Allows the output file content to be added to an existing output CAD file. The existing CAD file content will not be lost.
  • OVERWRITE_EXISTING_FILES —The 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

# 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

  • Current Workspace
  • Extent
  • Scratch Workspace

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics

  • Reserved CAD fields for MicroStation V8 DGN formats
  • Reserved CAD fields for AutoCAD DWG/DXF formats
  • An overview of the To CAD toolset
  • Supported CAD formats in ArcGIS

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal