I am working on a tool in a python toolbox and am totally confused about what is going on and causing my select by location operation to fail (Error 000368).
I am trying to select the features in one layer that are completely within a specific polygon. Here is the line where the error is occuring:
for (index,item) in enumerate(TempIDs):
lyrBoundaries.definitionQuery = "[" + parameters[1].valueAsText + "]" + " = " + "'" + str(item) + "'"
for (index2,item2) in enumerate(Spec_Layers):
currentLayer = arcpy.mapping.Layer(str(item2))
arcpy.SelectLayerByLocation_management(currentLayer,"WITHIN",lyrBoundaries)
arcpy.CalculateField_management(currentLayer,parameters[3].valueAsText,hopper,"VB","#")
The error is occurring in the arcpy.SelectLayerByLocation_management() line. The text of the error message I'm getting is: (edited to remove the actual text of the path)
Executing: SelectLayerByLocation "[FULL PATH OF currentLayer]" COMPLETELY_WITHIN GPL0 "0 Unknown" NEW_SELECTION
Start Time: Fri Mar 01 10:29:29 2013
Failed to execute. Parameters are not valid.
ERROR 000368: Invalid input data.
My question is really: Why is lyrBoundaries showing up as GPL0 and not as the path of the layer? Beyond that, any tips or hints about why the inputs are being interpreted as invalid?