<?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>idea Vary symbology by rotation using ArcPy in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idi-p/1239965</link>
    <description>&lt;P&gt;&lt;EM&gt;Edited&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;When creating feature layers using ArcPy:&lt;/P&gt;&lt;P&gt;There doesn’t seem to be a way to&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/vary-symbology-by-rotation.htm" target="_blank" rel="noopener nofollow noreferrer"&gt;Vary symbology by rotation&lt;/A&gt;&amp;nbsp;using&amp;nbsp;ArcPy.&lt;/P&gt;&lt;P&gt;Could that functionality be added?&lt;/P&gt;&lt;P&gt;Related: ArcPy script to convert layer to individual feature layers for each symbology class&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/customize-pro-ui-checkboxes-in-toc-to-toggle/m-p/1239558/highlight/true#M9159" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-pro-sdk-questions/customize-pro-ui-checkboxes-in-toc-to-toggle/m-p/1239558/highlight/true#M9159&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jan 2023 15:43:50 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2023-01-23T15:43:50Z</dc:date>
    <item>
      <title>Vary symbology by rotation using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idi-p/1239965</link>
      <description>&lt;P&gt;&lt;EM&gt;Edited&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;When creating feature layers using ArcPy:&lt;/P&gt;&lt;P&gt;There doesn’t seem to be a way to&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/vary-symbology-by-rotation.htm" target="_blank" rel="noopener nofollow noreferrer"&gt;Vary symbology by rotation&lt;/A&gt;&amp;nbsp;using&amp;nbsp;ArcPy.&lt;/P&gt;&lt;P&gt;Could that functionality be added?&lt;/P&gt;&lt;P&gt;Related: ArcPy script to convert layer to individual feature layers for each symbology class&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-sdk-questions/customize-pro-ui-checkboxes-in-toc-to-toggle/m-p/1239558/highlight/true#M9159" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-pro-sdk-questions/customize-pro-ui-checkboxes-in-toc-to-toggle/m-p/1239558/highlight/true#M9159&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 15:43:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idi-p/1239965</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-01-23T15:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Apply symbol rotation using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1240032#M22523</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/symbol-class.htm" target="_blank"&gt;Symbol—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;angle&lt;BR /&gt;(Read and Write)&lt;BR /&gt;&lt;STRONG&gt;Gets and sets the rotation value of a point symbol.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Double&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 03:40:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1240032#M22523</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-12-12T03:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Apply symbol rotation using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1240052#M22524</link>
      <description>&lt;P&gt;The question is a bit unclear.&lt;/P&gt;&lt;P&gt;Yes, there is symbol.angle, but that sets the angle value of each symbol.&lt;/P&gt;&lt;P&gt;What&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/351335"&gt;@Bud&lt;/a&gt;&amp;nbsp;means is that there is no way in arcpy to&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/vary-symbology-by-rotation.htm" target="_blank" rel="noopener"&gt;Vary symbology by rotation—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 07:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1240052#M22524</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-12-12T07:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Vary symbology by rotation using ArcPy (edited) - Status changed to: Under Consideration</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1241136#M22527</link>
      <description>&lt;P&gt;This is something we can consider but it will be a long time before we can provide this level of detail via the curated API. In the meantime, the CIM may be an option.&amp;nbsp; Before reviewing the code below it may be worth reviewing the Python CIM Access help topic:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I started with:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BEFORE_UI.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58520i7DFD32D7230CB1B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BEFORE_UI.PNG" alt="BEFORE_UI.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As suggested in the topic above, I created a before and after layer, saved them to LYRX files and compared the JSON differences.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JSON_Difference.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58518i8DED7DACD83E6EF9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JSON_Difference.PNG" alt="JSON_Difference.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the code based on what I see above.&amp;nbsp; The before layer didn't have visual variable applied so I had to create the appropriate CIM objects, set the values to match above and then apply the newly created visual variable to the empty visual variable list associated with the layer.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject('current')
m = p.listMaps('Map')[0]
l = m.listLayers('*BEFORE')[0]
maxLabel = 360 #this could be automated

#Create a rotation visual variable via the CIM
l_cim = l.getDefinition('V3')
visVar = arcpy.cim.CreateCIMObjectFromClassName('CIMRotationVisualVariable', 'V3')
#Xinfo
visVar.visualVariableInfoX.randomMax = maxLabel
visVar.visualVariableInfoX.visualVariableInfoType = "None"
#Yinfo
visVar.visualVariableInfoY.randomMax = maxLabel
visVar.visualVariableInfoY.visualVariableInfoType = "None"
#Zinfo
visVar.visualVariableInfoZ.randomMax = maxLabel
visVar.visualVariableInfoZ.visualVariableInfoType = "Expression"
#Create expression for Xinfo
expInf = arcpy.cim.CreateCIMObjectFromClassName('CIMExpressionInfo', 'V3')
expInf.title = "Custom"
expInf.expression = "$feature.Rotation"  #field called rotation
expInf.returnType = "Default"

visVar.visualVariableInfoZ.valueExpressionInfo = expInf
visVar.rotationTypeZ = "Arithmetic"

l_cim.renderer.visualVariables.append(visVar) #Apply visual variable
l.setDefinition(l_cim) #set back to layer&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the final result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AFTER_UI.PNG" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58521iB78F2CD4B19583EF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AFTER_UI.PNG" alt="AFTER_UI.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp teams&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 16:16:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1241136#M22527</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2022-12-14T16:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Vary symbology by rotation using ArcPy (edited)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1241469#M22537</link>
      <description>&lt;P&gt;Thanks Jeff, that helps alot.&lt;/P&gt;&lt;P&gt;I have done some work with the CIM (especially configuring popups), but I haven't looked too far into it regarding symbology.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 08:13:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1241469#M22537</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-12-15T08:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Vary symbology by rotation using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1276486#M24319</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp; Hi, I looked at your code and tried&amp;nbsp; to implement it, but it didn't change my lyrx file as far as I can see.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a difference between 'V3' and 'V2' or shouldn't that make any difference?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 09:21:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1276486#M24319</guid>
      <dc:creator>AndreasB</dc:creator>
      <dc:date>2023-04-07T09:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Vary symbology by rotation using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1276652#M24327</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/467570"&gt;@AndreasB&lt;/a&gt;&amp;nbsp;V2 is intended for Pro 2x but will continue to work in 3x.&amp;nbsp; If they both don't work they way you are expecting then nothing was changed in the 2x CIM vs 3x.&amp;nbsp; I would need to see more of your code to understand what is not working.&lt;/P&gt;&lt;P&gt;Jeff - Layout and arcpy.mp teams&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 17:56:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1276652#M24327</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2023-04-07T17:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Vary symbology by rotation using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1329995#M26240</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1134"&gt;@JeffBarrette&lt;/a&gt;&amp;nbsp;Thanks to your solution,&amp;nbsp;&lt;SPAN&gt;Through cim, lyrx applied rotation and size was extracted from arcgis pro arcpy. However, I would also like to apply this to arcmap (arcgis desktop), but, on the arcmap arcpy, the getDefinition function does not seem to be available in Layer objects. I wonder if there is a possible way in arcmap arcpy.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 04:42:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1329995#M26240</guid>
      <dc:creator>fireapple</dc:creator>
      <dc:date>2023-09-19T04:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Vary symbology by rotation using ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1331277#M26291</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/717258"&gt;@fireapple&lt;/a&gt;&amp;nbsp;Python CIM access is not available to arcpy.mapping (for ArcMap).&amp;nbsp; ArcGIS Pro projects and document settings use the CIM specification for persistance where MXDs do not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jeff - arcpy.mp and Layout teams&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 21:15:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/vary-symbology-by-rotation-using-arcpy/idc-p/1331277#M26291</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2023-09-21T21:15:59Z</dc:date>
    </item>
  </channel>
</rss>

