layername = "Flowlines" result = arcpy.SelectLayerByLocation_management(layername, "WITHIN_A_DISTANCE", inpointgeo, bufferradius, "NEW_SELECTION")
Solved! Go to Solution.
inpoint = arcpy.Point(arcpy.GetParameter(0), arcpy.GetParameter(1)) inpointgeo = arcpy.PointGeometry(inpoint) bufferradius = arcpy.GetParameter(2) snapoption = arcpy.GetParameter(3) lyrFlow = "Flowlines" lyrWater = "Waterbodies" if snapoption.upper() == "FL": layername = lyrFlow else: layername = lyrWater result = arcpy.SelectLayerByLocation_management(layername, "WITHIN_A_DISTANCE", inpointgeo, bufferradius, "NEW_SELECTION")
if snapoption.upper() == "FL": result = arcpy.SelectLayerByLocation_management("Flowlines", "WITHIN_A_DISTANCE", inpointgeo, bufferradius, "NEW_SELECTION") else: result = arcpy.SelectLayerByLocation_management("Waterbodies", "WITHIN_A_DISTANCE", inpointgeo, bufferradius, "NEW_SELECTION")
inpoint = arcpy.Point(arcpy.GetParameter(0), arcpy.GetParameter(1)) inpointgeo = arcpy.PointGeometry(inpoint) bufferradius = arcpy.GetParameter(2) snapoption = arcpy.GetParameter(3) if snapoption.upper() == "FL": layername = "Flowlines" else: layername = "Waterbodies" result = arcpy.SelectLayerByLocation_management(layername, "WITHIN_A_DISTANCE", inpointgeo, bufferradius, "NEW_SELECTION")
inpoint = arcpy.Point(arcpy.GetParameter(0), arcpy.GetParameter(1)) inpointgeo = arcpy.PointGeometry(inpoint) bufferradius = arcpy.GetParameter(2) snapoption = arcpy.GetParameter(3) lyrFlow = "Flowlines" lyrWater = "Waterbodies" if snapoption.upper() == "FL": layername = lyrFlow else: layername = lyrWater result = arcpy.SelectLayerByLocation_management(layername, "WITHIN_A_DISTANCE", inpointgeo, bufferradius, "NEW_SELECTION")
if snapoption.upper() == "FL": result = arcpy.SelectLayerByLocation_management("Flowlines", "WITHIN_A_DISTANCE", inpointgeo, bufferradius, "NEW_SELECTION") else: result = arcpy.SelectLayerByLocation_management("Waterbodies", "WITHIN_A_DISTANCE", inpointgeo, bufferradius, "NEW_SELECTION")