I have 2 shape files. One is a polygon while other is polyline. I need to select all the polylines that are completely inside the polygon. However this doesnot seem to work in any way.
NewLinks = "NewLinks.shp"
Buffer = "Buffer.shp"
Buffer1 = "Buffer1.shp"
arcpy.MakeFeatureLayer_management(Buffer, Buffer1)
arcpy.SelectLayerByLocation_management(NewLinks, "COMPLETELY_WITHIN", Buffer1, "", "NEW_SELECTION", "NOT_INVERT")
Error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\management.py", line 7860, in SelectLayerByLocation
raise e
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000368: Invalid input data.
Failed to execute (SelectLayerByLocation).