Does anyone have any idea why I am getting the error?

I am trying to export multiple shapefiles to a single File Geodatabase.

>>> import arcpy
>>> arcpy.env.workspace = r"W:/gis/condition assessment/quad c/quad c shapefile"
>>> in_features = ["Cond_Asses_Ditch_C.shp", "Cond_Assess_Inlet_C.shp", "Cond_Assess_Manhole_C.shp", "Cond_Assess_Outlet_C.shp"]
>>> out_location = r"X:/data.gdb"
>>> arcpy.FeatureClassToFeatureClass_conversion(in_features, out_location)
Runtime error 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\conversion.py", line 1694, in FeatureClassToFeatureClass
    raise e
RuntimeError: Object: Error in executing tool
  • FeatureClassToFeatureClass_conversion takes a single feature class as input, you need to loop over your list and do one at a time. Also check the docs because you need to supply more to that function: desktop.arcgis.com/en/arcmap/10.3/tools/conversion-toolbox/… – mikewatt Jul 17 '19 at 17:11
  • @mikewatt Thanks. So what you're saying is that I actually need to call the FeatureClasstoFeatureClass_conversion() tool four separate times? – Jack gr Jul 17 '19 at 18:16
  • @mikewatt I think you have enough in you comment to be an answer. – PolyGeo Jul 17 '19 at 20:00
>>> import arcpy
>>> arcpy.env.workspace = r'X:\Quab B Shapefile'
>>> shpList = [r'X:\Quab B Shapefile\Ditch_QuadB_CondAssess.shp', r'X:\Quab B Shapefile\Inlet_QuadB_CondAssess.shp', r'X:\Quab B Shapefile\Manhole_QuadB_CondAssess.shp', r'X:\Quab B Shapefile\Outlet_QuadB_CondAssess.shp']
>>> for featureclass in shpList:
...     outPath = r'X:\data.gdb'
...     outName = arcpy.Describe(featureclass).baseName
...     arcpy.FeatureClassToFeatureClass_conversion(featureclass, outPath, outName)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.