Many of the geoprocessing tools work on a selection set, if one has been made prior to running the tool. In the ArcObjects .NET framework, there is a SelectionSet property of the IFeatureSelection interface. This allows one to determine whether or not a selection has been made, and to manipulate that selection. In the ArcPy site package, the Layer class in the mapping module does not expose anything involving selections. It would be extremely useful to expose the SelectionSet property in this module so that the Python coder could easily:
- Determine if a selection had been made.
- Get a count of how many features/records were selected.
- Further manipulate that selection.
This has been implemented in ArcGIS Pro (arcpy.mp) for a while. Changes will not be made to the arcpy.mapping API.
https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/layer-class.htm
See specifically:
Layer.getSelectionSet()
Layer.setSelectionSet({oidList}, [{method})
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.