Hello,
I am looking to rearrange classes in a SINGLE layer using arcpy mp. Here's a visual sample only:
![TylerT_0-1701201278480.png TylerT_0-1701201278480.png](https://community.esri.com/t5/image/serverpage/image-id/87339i9E2BA65424477143/image-dimensions/193x130?v=v2)
The documentation suggests LegendItems items is not settable (see image below) in basic arcpy.mp, although I did try and got an error suggesting the same.
![TylerT_0-1701203234568.png TylerT_0-1701203234568.png](https://community.esri.com/t5/image/serverpage/image-id/87345i070856423BD39F6D/image-size/medium?v=v2&px=400)
![TylerT_0-1701203168633.png TylerT_0-1701203168633.png](https://community.esri.com/t5/image/serverpage/image-id/87344i5F92B920689674DE/image-dimensions/579x85?v=v2)
So, I drilled into the CIM renderer groups , but can't quite get it working. The resulting map is void of symbology. Here's what I have so far.
# move Duplex legend/class to end
l_cim = lyr1.getDefinition('V2')
for grp in l_cim.renderer.groups:
for cls in grp.classes:
if cls.label == 'Duplex':
grp.classes = [x for x in grp.classes if x != cls] + [cls]
lyr1.setDefinition(l_cim)
Viewing the list grp.classes before and after shows the Duplex object moved to the end of the list, so I suppose there is more going on under the hood...or I'm missing something.
Bottom line is I'm looking to mimic/automate this GUI behavior from the symbology pane (or by right clicking a class > reorder (top, up, down, bottom). Any tips would be appreciated.
![TylerT_2-1701203735909.png TylerT_2-1701203735909.png](https://community.esri.com/t5/image/serverpage/image-id/87349iE2F7EA6F8F85376E/image-size/medium?v=v2&px=400)
Tyler