I am trying to select some features by "SelectLayerByAttribute_management" like this:
flayer = arcpy.MakeFeatureLayer_management(r"D:\LAKES.shp", "myLayer")
arcpy.SelectLayerByAttribute_management(flayer, "NEW_SELECTION", """"NAME" = 'Clarks Hill Lake'""")
cnt = arcpy.GetCount_management(flayer)
print cnt
arcpy.RefreshActiveView()
Everything is fine and cnt = 1, but in the map, it is not highlighted. How can highlight selected feature when you are running the arcpy script out of ArcGIS environment.
Solved! Go to Solution.
From you limited code, there is no reference to the active document.
http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/refreshactiveview.htm
see if the addition of the appropriate lines in the code sample there help
From you limited code, there is no reference to the active document.
http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/refreshactiveview.htm
see if the addition of the appropriate lines in the code sample there help