AnsweredAssumed Answered

Trying to rotate icon differently for each unique value in UniqueValueRenderer

Question asked by Zachary.Klaas.tc on Sep 18, 2018
Latest reply on Sep 18, 2018 by Zachary.Klaas.tc

Hi, why does this code rotate every item's icon instead of each icon separately?  I cannot get the necessary information from documentation available.  I want each unique value to have a differently rotated symbol:

 

l = m.listLayers("xylayer")[0]

sym = l.symbology

symList = sym.renderer.symbol.listSymbolsFromGallery("ShipAIS")

current = None

for symbol in symList:
  current = symbol

sym.updateRenderer("UniqueValueRenderer")
sym.renderer.fields = ["Combined_True_Heading"]

for grp in sym.renderer.groups:
  for itm in grp.items:
    itm.symbol = current
    if(itm.values[0][0] != "<Null>"):
      itm.symbol.angle = 360 - float(itm.values[0][0])
    else:
      continue

l.symbology = sym

Outcomes