Hi all,
I created a custom script which I also converted into a GP tool within ArcGIS pro. When I try to feed lists into this tool as input parameters in ArcGIS Notebooks it fails and provides generic error messages. The same tool works in Notebooks if I am to use a single field rather than a field list.
Here is my code -
toolbox = "C:\\Users\\Kedaravindan Bhaskar\\Documents\\ArcGIS\\Projects\\FBM_research\\FBTool\\firebreak.tbx"
arcpy.ImportToolbox(toolbox, "firebreak")
arcpy.FBCalc_firebreak('SusBui_Point_CopyFeatures', 'SusBui_Point_VEGCODE', 'DirNWL_Class_DirNWL', 'PT1_P_DirNWL_Slope_Type', 'PT1_P_DirNWL_Slope', 'DirNWL_FRD_DirNWL', 'buffer') # Here the tool runs successfuly
import arcpy
# Use arcpy.ListFields() to list fields in a feature class
Classfields = arcpy.ListFields('SusBui_Point_CopyFeatures', '*Class*', 'TEXT')
# Iterate over the fields and print their names
for field in Classfields:
print(field.name)
# Use arcpy.ListFields() to list fields in a feature class
SlopeVfields = arcpy.ListFields('SusBui_Point_CopyFeatures', '*Slope', 'FLOAT')
# Iterate over the fields and print their names
for field in SlopeVfields:
print(field.name)
# Use arcpy.ListFields() to list fields in a feature class
SlopeTfields = arcpy.ListFields('SusBui_Point_CopyFeatures', '*Slope_Type', 'TEXT')
# Iterate over the fields and print their names
for field in SlopeTfields:
print(field.name)
import arcpy
# Use arcpy.ListFields() to list fields in a feature class containing 'frd'
FRDfields = arcpy.ListFields('SusBui_Point_CopyFeatures', '*FRD*')
# Iterate over the fields and print their names
for field in FRDfields:
print(field.name)
arcpy.FBCalc_firebreak('SusBui_Point_CopyFeatures', 'SusBui_Point_VEGCODE', Classfields , SlopeTfields, SlopeVfields, FRDfields, 'buffer')
#### ERROR MESSAGE
RuntimeError Traceback (most recent call last)
In [26]:
Line 1: arcpy.FBCalc_firebreak('SusBui_Point_CopyFeatures', 'SusBui_Point_VEGCODE', Classfields , SlopeTfields, SlopeVfields, FRDfields, 'buffer')
File C:\Users\Kedaravindan Bhaskar\Documents\ArcGIS\Projects\FBM_research\FBTool\firebreak.tbx, in FBCalc:
Line 38: validation is performed. This method is called whenever a parameter
File C:\Users\Kedaravindan Bhaskar\Documents\ArcGIS\Projects\FBM_research\FBTool\firebreak.tbx, in FBCalc:
Line 35:
File C:\Users\Kedaravindan Bhaskar\AppData\Local\Programs\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py, in <lambda>:
Line 520: return lambda *args: val(*gp_fixargs(args, True))
RuntimeError: Object: Error in executing tool
Nothing seems awry with the field names and types that are inputted into the tool so I am struggling to understand why this is happening. The error message is also quite generic.
I will also edit the 'buffer' (which is an output param) to do some form of inline variable substitution so multiple fields are populated but that shouldn't cause the issue at hand IMO.
My only thought is maybe I need to edit the script to accept lists??
Any idea what might be going wrong? Your help would be greatly appreciated : )
Please let me know if there is anything else I can do
Warm regards, Kedar