I want to symbolize a layer in an active session and add to display if some kind of value is right.
I found a way to symbolize in an active session here
So i tried to extend it, but unfortunately it doesn't work that way
myMXD = arcpy.mapping.MapDocument("Current")
lstDataFrames = arcpy.mapping.ListDataFrames(myMXD)
dlrLayer = arcpy.mapping.ListLayers(myMXD,"layer_name")
allFrames = arcpy.mapping.ListDataFrames(myMXD)
dlr_rows = arcpy.SearchCursor(path)
for dlr_row in dlr_rows:
if dlr_row.getValue("field_name") == "Value":
for dataFrame in allFrames:
myMXD.activeView = dataFrame
for mapLayer in dlrLayer:
arcpy.ApplySymbologyFromLayer_management(mapLayer, path)
else:
arcpy.AddMessage("Error")
How could i do that?