<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Trying to rotate icon differently for each unique value in UniqueValueRenderer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/trying-to-rotate-icon-differently-for-each-unique/m-p/520329#M40754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, why does this code rotate every item's icon instead of each icon separately?&amp;nbsp; I cannot get the necessary information from documentation available.&amp;nbsp; I want each unique value to have a differently rotated symbol:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l = m.listLayers("xylayer")[0]&lt;/P&gt;&lt;P&gt;sym = l.symbology&lt;/P&gt;&lt;P&gt;symList = sym.renderer.symbol.listSymbolsFromGallery("ShipAIS")&lt;/P&gt;&lt;P&gt;current = None&lt;/P&gt;&lt;P&gt;for symbol in symList:&lt;BR /&gt;&amp;nbsp; current = symbol&lt;/P&gt;&lt;P&gt;sym.updateRenderer("UniqueValueRenderer")&lt;BR /&gt;sym.renderer.fields = ["Combined_True_Heading"]&lt;/P&gt;&lt;P&gt;for grp in sym.renderer.groups:&lt;BR /&gt;&amp;nbsp; for itm in grp.items:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; itm.symbol = current&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(itm.values[0][0] != "&amp;lt;Null&amp;gt;"):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itm.symbol.angle = 360 - float(itm.values[0][0])&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; continue&lt;/P&gt;&lt;P&gt;l.symbology = sym&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Sep 2018 14:41:52 GMT</pubDate>
    <dc:creator>ZacharyKlaas</dc:creator>
    <dc:date>2018-09-18T14:41:52Z</dc:date>
    <item>
      <title>Trying to rotate icon differently for each unique value in UniqueValueRenderer</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-rotate-icon-differently-for-each-unique/m-p/520329#M40754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, why does this code rotate every item's icon instead of each icon separately?&amp;nbsp; I cannot get the necessary information from documentation available.&amp;nbsp; I want each unique value to have a differently rotated symbol:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l = m.listLayers("xylayer")[0]&lt;/P&gt;&lt;P&gt;sym = l.symbology&lt;/P&gt;&lt;P&gt;symList = sym.renderer.symbol.listSymbolsFromGallery("ShipAIS")&lt;/P&gt;&lt;P&gt;current = None&lt;/P&gt;&lt;P&gt;for symbol in symList:&lt;BR /&gt;&amp;nbsp; current = symbol&lt;/P&gt;&lt;P&gt;sym.updateRenderer("UniqueValueRenderer")&lt;BR /&gt;sym.renderer.fields = ["Combined_True_Heading"]&lt;/P&gt;&lt;P&gt;for grp in sym.renderer.groups:&lt;BR /&gt;&amp;nbsp; for itm in grp.items:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; itm.symbol = current&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(itm.values[0][0] != "&amp;lt;Null&amp;gt;"):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itm.symbol.angle = 360 - float(itm.values[0][0])&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; continue&lt;/P&gt;&lt;P&gt;l.symbology = sym&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 14:41:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-rotate-icon-differently-for-each-unique/m-p/520329#M40754</guid>
      <dc:creator>ZacharyKlaas</dc:creator>
      <dc:date>2018-09-18T14:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to rotate icon differently for each unique value in UniqueValueRenderer</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-rotate-icon-differently-for-each-unique/m-p/520330#M40755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; itm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;values&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;lt;null&amp;gt; is how it shows in the geodatabase table, None is python.&amp;nbsp; Assuming it is not an empty string then you have to check a bit more&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; itm&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;values&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 15:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-rotate-icon-differently-for-each-unique/m-p/520330#M40755</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-18T15:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to rotate icon differently for each unique value in UniqueValueRenderer</title>
      <link>https://community.esri.com/t5/python-questions/trying-to-rotate-icon-differently-for-each-unique/m-p/520331#M40756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Dan.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I made the change and it ended up not catching the cases that are null, probably because the data table this is being run on is the result of a join and what is in those cells are Strings (that is, the String "&amp;lt;Null&amp;gt;").&lt;BR /&gt;&lt;BR /&gt;So presently I've changed this to "if itm.values[0][0] not in ("&amp;lt;Null&amp;gt;", None):" and it is still catching the instances where it says "&amp;lt;Null&amp;gt;", while also catching any other potential instances of no value for a particular cell, so it's an improvement in the code to be sure.&lt;BR /&gt;&lt;BR /&gt;It's still not solving the issue with the icons rotating as a group rather than allowing me to rotate each individually, though.&amp;nbsp; Is there another way I can get at that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 15:37:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trying-to-rotate-icon-differently-for-each-unique/m-p/520331#M40756</guid>
      <dc:creator>ZacharyKlaas</dc:creator>
      <dc:date>2018-09-18T15:37:52Z</dc:date>
    </item>
  </channel>
</rss>

