Verwenden von Python zum Importieren von CAD-Daten in eine Geodatabase
In diesem Python-Beispiel wird veranschaulicht, wie mit dem Werkzeug "Zusammenführen" CAD-Daten aus mehreren Zeichnungsdateien im gleichen Ordner in eine einzelne Feature-Class importiert werden.
# Name: ImportCADandMerge.py
# Description: Imports and merges polylines from one workspace into a single feature class
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
env.workspace = "c:/data/columbia"
# Create a value table that will hold the input feature classes for Merge
vTab = arcpy.ValueTable()
# Step through each dataset in the list
for fd in arcpy.ListDatasets("*", "CAD"):
layername = fd + "_Layer"
# Select only the Polyine features on the drawing layer b-railroad
arcpy.MakeFeatureLayer_management(fd + "/Polyline", layername, "\"Layer\" = 'B-RAILROAD'")
vTab.addRow(layername)
# Merge the CAD features into one feature class
arcpy.Merge_management(vTab, "c:/data/columbia/Columbia.gdb/Railroads")
Verwandte Themen
7/10/2012