
public sealed class NorthArrow : MapSurround, System.ComponentModel.INotifyPropertyChanged, System.IComparable, System.IEquatable<Element>
Public NotInheritable Class NorthArrow Inherits MapSurround Implements System.ComponentModel.INotifyPropertyChanged, System.IComparable, System.IEquatable(Of Element)
//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); });
System.Object
ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
ArcGIS.Desktop.Layouts.Element
ArcGIS.Desktop.Layouts.MapSurround
ArcGIS.Desktop.Layouts.NorthArrow
Target Platforms: Windows 10, Windows 8.1, Windows 7