AnsweredAssumed Answered

Trying to rotate icon differently for each unique value in UniqueValueRenderer

Question asked by on Sep 18, 2018
Latest reply on Sep 18, 2018 by

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.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])

l.symbology = sym