I'm integrating the Average Nearest Neighbor (ANN) tool into a custom Python Toolbox tool. When I run ANN from the default ArcToolbox dialog it works great. When I call the ANN tool via arcpy using the same input and parameters the tool fails; I get ERROR 000224 Cannot insert features.
The problem appears to be related to the fourth parameter, called "Area". I want to use the default, so I pass "#" as the fourth parameter like so:
...it works. Any ideas on why this is happening? In both cases the input is a Query Layer. As I said, the default works just fine with the exact same data when I run the Average Nearest Neighbor tool on its own.