ArcGIS Pro 2.8 API Reference Guide
CreateNorthArrow Method (IElementFactory)
Example 

ArcGIS.Desktop.Layouts Namespace > IElementFactory Interface : CreateNorthArrow Method
Layout or GroupElement
Coordinate2D
MapFrame
Map
Creates a north arrow element on a layout from a 2D coordinate geometry. This method must be called on the MCT. Use QueuedTask.Run.
Syntax

Parameters

elementContainer
Layout or GroupElement
coord2D
Coordinate2D
mapFrame
MapFrame
styleItem
Map

Return Value

Returns a NorthArrow.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Remarks
If the element container is a Layout then the element gets added to the root level of the layout TOC at the top most position. If the element container is a GroupElement then it gets added to the group at the topmost position.
Example
//Create a north arrow for a specific map frame and assign a north arrow style item.

//Construct on the worker thread
await QueuedTask.Run(() =>
{
  //Reference a North Arrow in a style
  StyleProjectItem stylePrjItm = Project.Current.GetItems<StyleProjectItem>().FirstOrDefault(item => item.Name == "ArcGIS 2D");
  NorthArrowStyleItem naStyleItm = stylePrjItm.SearchNorthArrows("ArcGIS North 10")[0];

  //Build geometry
  Coordinate2D center = new Coordinate2D(7, 5.5);

  //Reference MF, create north arrow and add to layout 
  MapFrame mf = layout.FindElement("New Map Frame") as MapFrame;
  if (mf == null)
  {
    ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Map frame not found", "WARNING");
    return;
  }
  NorthArrow arrowElm = LayoutElementFactory.Instance.CreateNorthArrow(layout, center, mf, naStyleItm);
  arrowElm.SetName("New North Arrow");
  arrowElm.SetHeight(1.75);
  arrowElm.SetX(7);
  arrowElm.SetY(6);
});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

IElementFactory Interface
IElementFactory Members