SearchCursor do not loop after select layer with empty result

1138
10
Jump to solution
11-13-2020 02:10 AM
by Anonymous User
Not applicable

I have noticed that after select layer by location/attribute with empty result (example, i tried select layer with attribute, which that do not have), SearchCursor do not see rows in layer table. I tried SearchCursor layer write with dataSource, it's work on *.gdb whom i have physical access, but for *.sde whom i do not have physical access it's do not work ('Cannot open file' error). If i can select all layers features, than SearchCursor will see rows. I know about arcpy.SelectLayerByAttribute, but it is slow. I work with setSelectionSet and after clear selection with setSelectionSet('new', []) is same problem. How me revive layer after select with empty result?

Please, help me and sorry for my English!

0 Kudos
10 Replies
by Anonymous User
Not applicable

Yes, i understood and not only layer.setSelectionSet do it, but SelectLayerByAttribute/Location too. I think about how deteck damaged layer and if found than run SelectLayerByAttribute "clear_selection".

0 Kudos