PROBLEM
If a search cursor is run on a feature class, it returns all features. However, if a selection tool (such as Select By Location) is run prior to the search cursor, and nothing is selected, the search cursor returns no results.
This is expected behavior. ArcMap recognizes if a selection has been run on a feature class and only returns selected features. If no features were selected, no features are returned after the search has been run.
if count == 0: arcpy.SelectLayerByAttribute_management("Box","CLEAR_SELECTION")
Get help from ArcGIS experts
Download the Esri Support App