Solved! Go to Solution.
import arcpy from arcpy import mapping from arcpy import env mxd = mapping.MapDocument("CURRENT") df = mapping.ListDataFrames(mxd)[0] spatialReference = df.spatialReference env.outputCoordinateSystem = spatialReference # Script arguments Point_Selection = arcpy.GetParameterAsText(0) Polygon_Selection = arcpy.GetParameterAsText(1) # Process: Select Layer By Location arcpy.SelectLayerByLocation_management(Polygon_Selection, "INTERSECT", Point_Selection, "", "NEW_SELECTION") arcpy.RefreshActiveView()
import arcpy # Script arguments Point_Selection = arcpy.GetParameterAsText(0) Polygon_Selection = arcpy.GetParameterAsText(1) # Process: Select Layer By Location arcpy.SelectLayerByLocation_management(Polygon_Selection, "INTERSECT", Point_Selection, "", "NEW_SELECTION") arcpy.RefreshActiveView()
import arcpy features = arcpy.GetParameterAsText(0) layertoSelect = arcpy.GetParameterAsText(1) result = arcpy.GetCount_management(layertoSelect) arcpy.AddMessage("x = " + str(result.getOutput(0))) arcpy.SelectLayerByLocation_management(layertoSelect,"INTERSECT",features,"","NEW_SELECTION") for m in range(0,arcpy.GetMessageCount()-1): arcpy.AddMessage(arcpy.GetMessage(m)) arcpy.RefreshActiveView()