I have created a python toolbox tool for ArcGIS Pro, added parameters, and set it up so that Pro is displaying the tool and not complaining about any syntax errors, but for some reason three oddities are occuring.
class PolygonCentroidToPoint(object): def __init__(self): """ Define the tool (tool name is the name of the class). """ self.label = "Polygon Centroid To Point" self.canRunInBackground = True
Take a look and see if you spot anything, I've probably been staring at this too long and am missing something obvious...
The python console does print errors when the tool runs though, but it doesn't really seem to mean much.
Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "J:\Scripts and Tools\Python_Tools\Utilities.pyt", line 64, in PolygonCentroidToPoint File "J:\Scripts and Tools\Python_Tools\Utilities.pyt", line 61, in PolygonCentroidToPoint File "c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py", line 500, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000816: The tool is not valid. Failed to execute (PolygonCentroidToPoint).
esri-python-tools/Polygon_Centroid_Tool.py at arcgis_pro · roemhildtg/esri-python-tools · GitHub
Solved! Go to Solution.
Found the problem, it of course was a simple typo. paramterType in the parameters should have been parameterType. I wish Pro would have thrown a more obvious error of some sort.
Found the problem, it of course was a simple typo. paramterType in the parameters should have been parameterType. I wish Pro would have thrown a more obvious error of some sort.