I am trying to write code that symbolizes a feature in a UniqueValueRenderer that draws upon two fields: Status & tgt_ret. I want to have certain value combinations of these fields to by grouped into the same symbol/label. When intially 6 unique symbols are created for the 6 unique value combinations (Status, tgt_ret): [CLOSED, HE], [CLOSED, No Drop], [CLOSED, Practice], [OPEN, HE], [OPEN, No Drop], [OPEN Practice]
I only need three symbols formatted as follows:
[CLOSED, HE] with the label HE Closed
[[CLOSED, No Drop], [CLOSED, Practice]] with the label Closed
[[OPEN, HE], [OPEN, No Drop], [OPEN, Practice]] with the label Open
Does anyone have any idea on how to combine the values? I am having a hard time deciphering the the example code within the documentation for uniquevaluerenderer, Groups, and GroupItems. This is how I have it set up, but have not made much meaningful progress after this.
Target_layer= map_view.listLayers("Targets")[0]
arcpy.AddMessage("Target Layer Found")
Target_Sym= Target_layer.symbology
arcpy.AddMessage("Symbology Accessed")
Target_Sym.updateRenderer('UniqueValueRenderer')
arcpy.AddMessage("Update Renderer")
Target_Sym.renderer.fields= ['Status', 'tgt_ret']
arcpy.AddMessage("Renderer Fields Set")