Last active
January 13, 2023 18:23
-
-
Save nmpeterson/6117049 to your computer and use it in GitHub Desktop.
An arcpy-dependent function for checking whether any features are currently selected in the specified feature layer or table view.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import arcpy | |
def check_selection(lyr): | |
"""Check whether specified feature layer has a selection.""" | |
desc = arcpy.Describe(lyr) | |
selected = desc.FIDSet | |
return len(selected) > 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment