0

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
arcpy.ImportToolbox("M:/GIS-Data/Poin2Line.tbx")
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 )`
PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jul 18, 2014 at 8:57

1 Answer 1

1

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
arcpy.ImportToolbox("M:/GIS-Data/Poin2Line.tbx")
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 )
answered Jul 18, 2014 at 9:18
2
  • 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. Commented Jul 18, 2014 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). Commented Jul 18, 2014 at 11:18

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.