AnsweredAssumed Answered

Unselect features from arcpy.GetCount_management

Question asked by CCweedcontrol on May 31, 2017
Latest reply on Jun 6, 2017 by CCweedcontrol

I have a script that runs in arcmap Python window. It does a select layer by location then exports the selected features but i need to remove features with Null or empty attributes in a specific filed before acpy.TableToTable but some times there will be none with Null or empty attributes. I am not sure how to do that so if someone could show me how to this it would be awesome.

 

Currently this is the code i  have.

 

TA = "TAXLOTS"
SP4 = "SUBJECT_PROPERTY"

arcpy.SelectLayerByLocation_management(TA, "WITHIN_A_DISTANCE", SP4, "600 Feet", "NEW_SELECTION")

try:
    if int(arcpy.GetCount_management("TAXLOTS").getOutput(0)) > 0:
        arcpy.TableToTable_conversion("TAXLOTS", wp, "NOTIFIED_LOTS.dbf")

    arcpy.SelectLayerByAttribute_management("TAXLOTS", "CLEAR_SELECTION")
except:
    pass

Outcomes