<?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: North Arrow not changing in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/north-arrow-not-changing/m-p/1274239#M9594</link>
    <description>&lt;P&gt;I cannot repro.&lt;/P&gt;&lt;P&gt;U can also try this as a workaround:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;QueuedTask.Run(()=&amp;gt; {
 ...
 var naStyleItem = arcgis2dStyles.SearchNorthArrows("ArcGIS North 13").FirstOrDefault();
 //get the item definition
 var cim_na = naStyleItem.GetObject() as CIMMarkerNorthArrow;
 ...
 var naInfo = new NorthArrowInfo() {
   MapFrameName = newFrame.Name,
   //NorthArrowStyleItem = naStyleItem
 };
 var newNorthArrow = ElementFactory.Instance.CreateMapSurroundElement(
   layout_local, nArrow.ToMapPoint(), naInfo);
 //Apply the style
 var def = newNorthArrow.GetDefinition() as CIMMarkerNorthArrow;
 def.GraphicFrame = cim_na.GraphicFrame;
 def.PointSymbol = cim_na.PointSymbol;
 newNorthArrow.SetDefinition(def);

});&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 31 Mar 2023 18:43:43 GMT</pubDate>
    <dc:creator>CharlesMacleod</dc:creator>
    <dc:date>2023-03-31T18:43:43Z</dc:date>
    <item>
      <title>North Arrow not changing</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/north-arrow-not-changing/m-p/1274120#M9592</link>
      <description>&lt;P&gt;ArcGIS Pro 3.1 SDK addin is not changing the north arrow using this code:&lt;/P&gt;&lt;P&gt;// Add North Arrow&lt;BR /&gt;StyleProjectItem arcgis2dStyles = Project.Current.GetItems&amp;lt;StyleProjectItem&amp;gt;().First(si =&amp;gt; si.Name == "ArcGIS 2D");&lt;BR /&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;NorthArrowStyleItem naStyleItem = arcgis2dStyles.SearchNorthArrows("ArcGIS North 13").FirstOrDefault();&lt;BR /&gt;MapFrame newFrame = layout_local.FindElement("New Map Frame") as MapFrame;&lt;BR /&gt;Coordinate2D nArrow = new Coordinate2D(3.6814, 0.6357);&lt;BR /&gt;var naInfo = new NorthArrowInfo()&lt;BR /&gt;{&lt;BR /&gt;MapFrameName = newFrame.Name,&lt;BR /&gt;NorthArrowStyleItem = naStyleItem&lt;BR /&gt;};&lt;BR /&gt;var newNorthArrow = ElementFactory.Instance.CreateMapSurroundElement(layout_local, nArrow.ToMapPoint(), naInfo);&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;I want this one:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mstranovsky_0-1680275630825.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66942i963AA720EB3A7C2B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mstranovsky_0-1680275630825.png" alt="mstranovsky_0-1680275630825.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But I get this one no matter what I put in here (SearchNorthArrows("ArcGIS North 13")):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mstranovsky_1-1680275717844.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66943iF22B9B58E59A8769/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mstranovsky_1-1680275717844.png" alt="mstranovsky_1-1680275717844.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 15:15:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/north-arrow-not-changing/m-p/1274120#M9592</guid>
      <dc:creator>mstranovsky</dc:creator>
      <dc:date>2023-03-31T15:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: North Arrow not changing</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/north-arrow-not-changing/m-p/1274239#M9594</link>
      <description>&lt;P&gt;I cannot repro.&lt;/P&gt;&lt;P&gt;U can also try this as a workaround:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;QueuedTask.Run(()=&amp;gt; {
 ...
 var naStyleItem = arcgis2dStyles.SearchNorthArrows("ArcGIS North 13").FirstOrDefault();
 //get the item definition
 var cim_na = naStyleItem.GetObject() as CIMMarkerNorthArrow;
 ...
 var naInfo = new NorthArrowInfo() {
   MapFrameName = newFrame.Name,
   //NorthArrowStyleItem = naStyleItem
 };
 var newNorthArrow = ElementFactory.Instance.CreateMapSurroundElement(
   layout_local, nArrow.ToMapPoint(), naInfo);
 //Apply the style
 var def = newNorthArrow.GetDefinition() as CIMMarkerNorthArrow;
 def.GraphicFrame = cim_na.GraphicFrame;
 def.PointSymbol = cim_na.PointSymbol;
 newNorthArrow.SetDefinition(def);

});&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 31 Mar 2023 18:43:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/north-arrow-not-changing/m-p/1274239#M9594</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2023-03-31T18:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: North Arrow not changing</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/north-arrow-not-changing/m-p/1274264#M9595</link>
      <description>&lt;P&gt;I tried it and receive this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.NullReferenceException: 'Object reference not set to an instance of an object.'&lt;/P&gt;&lt;P&gt;naStyleItem was null.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 19:42:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/north-arrow-not-changing/m-p/1274264#M9595</guid>
      <dc:creator>mstranovsky</dc:creator>
      <dc:date>2023-03-31T19:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: North Arrow not changing</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/north-arrow-not-changing/m-p/1274284#M9596</link>
      <description>&lt;P&gt;that's why yours doesnt work then. Check your ArcGIS 2D style and why it doesnt contain a "&lt;SPAN&gt;ArcGIS North 13"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 20:31:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/north-arrow-not-changing/m-p/1274284#M9596</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2023-03-31T20:31:00Z</dc:date>
    </item>
  </channel>
</rss>

