Manipulate Symbol Layer Drawing in Arcpy

08-10-2022 07:04 AM
New Contributor II


Is there a way using Arcpy, to change symbol layer drawing settings for a layer that uses the UniqueValueRenderer. I am looking to adjust settings in the menu in the screenshot programmatically to ensure that the map layers draw in the correct order. Specifically, it would be nice if there is an arcpy method that I can use to programmatically reset the Symbol layer drawing settings. I can provide additional details if necessary. Thank you in advance.


Symbol Layer Drawing.PNG

Symbol Layer Drawing Reset Button.PNG

0 Kudos
1 Reply
by MVP Regular Contributor
MVP Regular Contributor

I'm wondering if this could be done through the UniquaValueRenderer class by manipulating the ItemGroup.


From the docs: If, for whatever reason, new values are added to the layer, you will need to reset the renderer so that all the values are added again. You can do this by changing the fields property, or you can use the addValues method.

You need to understand how unique values are managed in the renderer so you can navigate through the class structure to change individual items and their values. The groups property returns a list of ItemGroup objects. Each ItemGroup represents a category of items that each have their own heading. By default, there is one ItemGroup. The items property returns a list of Item objects. Once you have an item, you can change properties such as label and description. You can also modify the symbol for each item.

So for the drawing order, if that is what you are after, maybe arrange the items in the item group to the order you want and see if it works or use the remove/ addItem methods.

0 Kudos