<?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 Re: Assigning an icon from a .stylx file and rotating it, in arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266399#M20501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for responding so quickly Thomas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue is more the python code (applySymbolFromGallery) not recognising symbols in project style files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jul 2020 20:06:32 GMT</pubDate>
    <dc:creator>MarkTurnbull</dc:creator>
    <dc:date>2020-07-21T20:06:32Z</dc:date>
    <item>
      <title>Assigning an icon from a .stylx file and rotating it, in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266396#M20498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to use arcpy to apply a symbol from a .stylx file and then rotate the symbol according to a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doing this manually, this merely involves clicking on the icon from the gallery pane (where the symbol is located despite being in a .stylx file, the style is clearly regarded as a "project style") and then using "Vary symbology by attribute", "Rotation", selecting the rotation variable, and geographic style for the method of rotation.&amp;nbsp; It's easy manually, I just want my script to do it automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The relevant code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;m = aprx.listMaps("AIS Live Feed")[0]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;l = m.listLayers("xylayer")[0]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;sym = l.symbology&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;##begin code that doesn't work&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;sym.renderer.symbol.applySymbolFromGallery("ShipAIS")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;##end code that doesn't work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't regard my ShipAIS icon, stored in its .stylx file, as part of my gallery.&amp;nbsp; I am able to get the icon to change with this code if I select one that is in my default gallery.&amp;nbsp; Even doing that, though, I don't know how to direct arcpy to rotate an icon once I'm able to access it - there appears to be an "angle" attribute, but I'm not sure how to apply it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how I might do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 15:45:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266396#M20498</guid>
      <dc:creator>ZacharyKlaas</dc:creator>
      <dc:date>2018-09-06T15:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning an icon from a .stylx file and rotating it, in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266397#M20499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Zachary&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Were you able to resolve this problem. I am encountering exactly the same issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 18:12:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266397#M20499</guid>
      <dc:creator>MarkTurnbull</dc:creator>
      <dc:date>2020-07-21T18:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning an icon from a .stylx file and rotating it, in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266398#M20500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll need to get down to the CIM level for the rotation piece.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more detailed information please take a look at&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/python-cim-access.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/mapping/python-cim-access.htm"&gt;Python CIM access—ArcPy | Documentation&lt;/A&gt;&amp;nbsp;as well as an excellent presentation from the Dev Summit&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=RkyzeOgCHe4&amp;amp;list=PLaPDDLTCmy4Ys8vfmC7DbX3FHSsyosvh7&amp;amp;index=28"&gt;https://www.youtube.com/watch?v=RkyzeOgCHe4&amp;amp;list=PLaPDDLTCmy4Ys8vfmC7DbX3FHSsyosvh7&amp;amp;index=28&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 18:49:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266398#M20500</guid>
      <dc:creator>ThomasEmge</dc:creator>
      <dc:date>2020-07-21T18:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning an icon from a .stylx file and rotating it, in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266399#M20501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for responding so quickly Thomas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue is more the python code (applySymbolFromGallery) not recognising symbols in project style files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 20:06:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266399#M20501</guid>
      <dc:creator>MarkTurnbull</dc:creator>
      <dc:date>2020-07-21T20:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning an icon from a .stylx file and rotating it, in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266400#M20502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying that even with&amp;nbsp;&lt;EM&gt;listSymbolsFromGallery(&amp;lt;your_symbol&amp;gt;)&amp;nbsp;&lt;/EM&gt;you get back an empty list?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just tried it with Pro 2.6 and it seems to work in my list test case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and to complete Zachary's code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;l&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;symbology &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sym&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>Thu, 23 Jul 2020 19:28:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/assigning-an-icon-from-a-stylx-file-and-rotating/m-p/266400#M20502</guid>
      <dc:creator>ThomasEmge</dc:creator>
      <dc:date>2020-07-23T19:28:19Z</dc:date>
    </item>
  </channel>
</rss>

