1

I have several CAD files (DWG) that I want converted to Feature Classes within a file GDB. Each feature class will be based on a polyline attribute "LAYER" value, so I have a query filter applied before they get loaded into the GDB.

I think my script (Python 2.7) has a problem with there being no values being written to the ValueTable. Here's the script, followed by the error message - can anyone please help?

=================================

# Description: Imports and merges polylines from one CAD workspace into a single feature class
import arcpy 
from arcpy import env
env.workspace = "X:/GEMS_vector_data/DWG_files_sites_floors/0011-test" 
CADgdb = "X:/GEMS_vector_data/DWG_files_sites_floors/0011-test/CADToFeatures.gdb"
# 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 + "_level"
 # Select only the Polyine features for external walls
 arcpy.MakeFeatureLayer_management(fd + "/Polyline", CADgdb + LayerName, "\"Layer\" = 'AR_WALL_EXT'")
 vTab.addRow(LayerName)
# Merge the CAD features into one feature class
MergedFloorPlans = "X:/GEMS_vector_data/DWG_files_sites_floors/0011-test/CADToFeatures.gdb/Floors01"
arcpy.Merge_management(vTab, MergedFloorPlans)

================================

Error msg

Traceback (most recent call last): File "X:\GEMS_vector_data\DWG_files_sites_floors0011円-test\import_CAD_to_FBDB_01.py", line 26, in arcpy.Merge_management(vTab, MergedFloorPlans) File "D:\Program Files\ArcGIS\Server\arcpy\arcpy\management.py", line 3762, in Merge raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000735: Input Datasets: Value is required Failed to execute (Merge).

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jan 30, 2014 at 23:21

1 Answer 1

2

I had the same problem today.It turns out that ESRI sample that you used is wrong. they used

for fd in arcpy.ListDatasets("*", "CAD"):

but "CAD" is wrong, is not a valid feature type for this tool - remove it and the script will work, or use "*.dwg".

answered Aug 1, 2014 at 11:14

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.