I have script that I run quite regularly in the python window of Arcmap 10.2.2 and am in the process of converting it to a toolbox script so that others can use it more easily.
It uses select layer by location a number of times, for example:
arcpy.SelectLayerByLocation_management(Contours_G_1m, "CONTAINS", peakpoints)
It worked fine in the python window but now that its in a tool it fails with
Parameters are not valid. ERROR 000368: Invalid input data
This is not at all surprising because this tool works on a layer and the script does not add a layer to the map when it creates a new feature class.
Is there any way of selecting the feature in a shapefile rather than a layer by location, or a workaround for using this tool in a script?