<?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: How to set the rotationfield for a featurelayer using ArcGIS Pro SDK for .NET? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-the-rotationfield-for-a-featurelayer/m-p/1063957#M6642</link>
    <description>&lt;P&gt;Thanks a lot. With the above example I was able to deduce what was necessary to define the rotation field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jun 2021 06:11:13 GMT</pubDate>
    <dc:creator>JFr87</dc:creator>
    <dc:date>2021-06-02T06:11:13Z</dc:date>
    <item>
      <title>How to set the rotationfield for a featurelayer using ArcGIS Pro SDK for .NET?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-the-rotationfield-for-a-featurelayer/m-p/1063282#M6625</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;how do you set the rotationfield for a featurelayer using the ArcGIS Pro SDK for .NET? I guess it's possible somehow, but I didn't find any examples how to do this. It's possible to configure the field in the layer settings of ArcGIS Pro like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JFr87_0-1622462930634.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14619i73CAC6EC1A60DFF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JFr87_0-1622462930634.png" alt="JFr87_0-1622462930634.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I want to do is make the setting pictured above by using the ArcGIS Pro SDK for .NET.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 31 May 2021 12:12:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-the-rotationfield-for-a-featurelayer/m-p/1063282#M6625</guid>
      <dc:creator>JFr87</dc:creator>
      <dc:date>2021-05-31T12:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the rotationfield for a featurelayer using ArcGIS Pro SDK for .NET?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-the-rotationfield-for-a-featurelayer/m-p/1063616#M6635</link>
      <description>&lt;P&gt;The rotation information is stored in the layer's CIM definition.&amp;nbsp; You can use the CIM Viewer tool to interrogate the layer's CIM defintion's content:&amp;nbsp; &lt;A href="https://github.com/esri/arcgis-pro-sdk-cim-viewer" target="_blank"&gt;Esri/arcgis-pro-sdk-cim-viewer (github.com)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you activate the tool and make the desired symbology settings manually, you can then 'show the CIM' to view the layer's CIM definition.&amp;nbsp; It will look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1622558910532.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14706i3243EBB6837F2015/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1622558910532.png" alt="Wolf_0-1622558910532.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Once you have the CIM definition you can the write the code to get/set the CIM definition programmatically.&amp;nbsp; In your case you are interested in the CIMRenderer.&amp;nbsp; I supplied the code to &lt;STRONG&gt;read&lt;/STRONG&gt; the CIM, but you can make changes to the renderer as well.&amp;nbsp; There are some snippets and community samples on how to set a renderer.&amp;nbsp; Once you make programmatic changes to the CIM you always have to use the corresponding 'Set' function to submit the changed CIM to the layer (i.e. GetRenderer() / SetRenderer(...)).&amp;nbsp; Here is my sample [Button / OnClick] code to &lt;STRONG&gt;read&lt;/STRONG&gt; the renderer's rotation settings:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;protected override void OnClick()
{
	var pointLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().Where(fl =&amp;gt; fl.Name.Contains("TestPoint")).FirstOrDefault();
	if (pointLayer == null) return;
	QueuedTask.Run(() =&amp;gt;
	{
		//Get simple renderer from the feature layer
		CIMSimpleRenderer currentRenderer = pointLayer.GetRenderer() as CIMSimpleRenderer;
		if (currentRenderer == null)
			return;
		// check if ArrayOfCIMVisualVariable exists
		if (currentRenderer.VisualVariables != null)
		{
			// check if CIMRotationVisualVariable exists
			foreach (var visualVar in currentRenderer.VisualVariables)
			{
				if (visualVar is CIMRotationVisualVariable cimRotationVisualVariable)
				{
					// rotation field info is under VisualVariableInfoZ
					var varInfoZ = cimRotationVisualVariable.VisualVariableInfoZ;
					// ValueExpressionInfo holds CIMExpressionInfo
					var varExpInfo = varInfoZ.ValueExpressionInfo;
					MessageBox.Show($@"{varExpInfo.Expression} rotation type: {cimRotationVisualVariable.RotationTypeZ}");
				}
			}
		}
	});
}&lt;/LI-CODE&gt;&lt;P&gt;Using the code above on my sample data results in this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_1-1622559271110.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14707i22413280050C391F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_1-1622559271110.png" alt="Wolf_1-1622559271110.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 14:57:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-the-rotationfield-for-a-featurelayer/m-p/1063616#M6635</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-06-01T14:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the rotationfield for a featurelayer using ArcGIS Pro SDK for .NET?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-the-rotationfield-for-a-featurelayer/m-p/1063957#M6642</link>
      <description>&lt;P&gt;Thanks a lot. With the above example I was able to deduce what was necessary to define the rotation field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 06:11:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-the-rotationfield-for-a-featurelayer/m-p/1063957#M6642</guid>
      <dc:creator>JFr87</dc:creator>
      <dc:date>2021-06-02T06:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to set the rotationfield for a featurelayer using ArcGIS Pro SDK for .NET?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-the-rotationfield-for-a-featurelayer/m-p/1330166#M10418</link>
      <description>&lt;P&gt;Would you happen to remember what you did here? I'm looking to switch the rotation language to Arcade, and then populate with our rotation field in Arcade to satisfy it. Any help is much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 14:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-set-the-rotationfield-for-a-featurelayer/m-p/1330166#M10418</guid>
      <dc:creator>GrantYoungH</dc:creator>
      <dc:date>2023-09-19T14:53:04Z</dc:date>
    </item>
  </channel>
</rss>

