I've created a Spatial ETL tool from ArcGIS 10.1 and would like to run this tool to all 200 featureclasses in a geodatabase. Therefore, I've written a python script to do this automation. (btw, i'm new to arcpy) However, I get an error message stating that my featureclasses do not exist in the geodabase. It does exist though.

"Failed to execute. Parameters are not valid. 'Export1' does not exist. Failed to execute (SpatialETLTool152)"

I couldn't find any solution on the internet.

`import arcpy, os
from arcpy import env


env.workspace = r"L:\\ExportLines\\Test.gdb"
FakeTide_All1_tif = r"L:\\ExportLines\\FakeTide.tif"
Test_gdb = r"L:\\ExportLines\\Test.gdb"
Destination_Comma_Separated_Value__CSV__Directory_ = r"L:\\ExportLines\\Output"
fClass = arcpy.ListFeatureClasses()

for fc in fClass:
    arcpy.gp.toolbox = "M:/00-GIS-Data-4-All/Poin2Line.tbx";
#arguments (Tiff, output, input)
    arcpy.gp.SpatialETLTool152("'L:\\ExportLines\\FakeTide.tif'", Destination_Comma_Separated_Value__CSV__Directory_, fc )`

I've attempted to remove the errors from your code. You had "\\" but you started the string with an r so I think python was actually seeing "\\\\" instead of "\".

Also you import a toolbox at the beginning of the script then add another within the loop which has the same name, that makes no sense so I have commented it out. But may be wanted to use that one as it is in another location?

import arcpy, os
from arcpy import env


env.workspace = r"L:\ExportLines\Test.gdb"
Destination_Comma_Separated_Value__CSV__Directory_ = r"L:\ExportLines\Output"
fClass = arcpy.ListFeatureClasses()

# Whats this? You've already appeared to have imported your toolbox above
#  arcpy.gp.toolbox = "M:/00-GIS-Data-4-All/Poin2Line.tbx"
for fc in fClass:    
    #arguments (Tiff, output, input)
    arcpy.gp.SpatialETLTool152(r"L:\ExportLines\FakeTide.tif", Destination_Comma_Separated_Value__CSV__Directory_, fc )
  • Thank you for correcting and explaining my errors. I've cleaned up the scripts. It still doesn't loop through the featureclasses. I think it has to do with Spatial ETL and Model Builder. Going to work on it some more. – ArcPyNewbie Jul 18 '14 at 9:48
  • For troubleshooting you could also try to loop through your feature classes without calling your tool, e.g. with print(fc) instead of the arcpy.gp. -call inside the for loop. Thus you can isolate what exactly fails. Also, try to call your tool from a script with only one feature class (for testing purposes). – til_b Jul 18 '14 at 11:18

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.