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

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, 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.

  • IGNORE_FILENAMES_IN_TABLESIgnores the paths in the document entity fields and allows the output of all entities to a single CAD file.
  • USE_FILENAMES_IN_TABLESAllows 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_FILESAllows the output file content to 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

# Name: ExportToCAD.py
# Description: Create an AutoCAD DWG
# 10/1/2009

# 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

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

11/14/2011