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 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()
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()
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.