ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / ElementFactory Class / CreateArrowGraphicElement Method
The parent element container
The arrow geometry
The arrow info or "description"
An element name (optional)
Select after create flag (default is true) (optional)
Additional element properties (optional)
Example

In This Topic
    CreateArrowGraphicElement Method (ElementFactory)
    In This Topic
    Create an arrow graphic based on the provided geometry and ArrowInfo. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function CreateArrowGraphicElement( _
       ByVal elementContainer As IElementContainer, _
       ByVal arrowLine As Polyline, _
       ByVal arrowInfo As ArrowInfo, _
       Optional ByVal elementName As String, _
       Optional ByVal select As Boolean, _
       Optional ByVal elementInfo As ElementInfo _
    ) As GraphicElement

    Parameters

    elementContainer
    The parent element container
    arrowLine
    The arrow geometry
    arrowInfo
    The arrow info or "description"
    elementName
    An element name (optional)
    select
    Select after create flag (default is true) (optional)
    elementInfo
    Additional element properties (optional)

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    empty or null geometry
    Example
    Create Line Arrow Element
    //Must be on QueuedTask.Run(() => { ...
    
    //Build geometry
    List<Coordinate2D> plCoords = new List<Coordinate2D>();
    plCoords.Add(new Coordinate2D(1, 8.5));
    plCoords.Add(new Coordinate2D(1.66, 9));
    plCoords.Add(new Coordinate2D(2.33, 8.1));
    plCoords.Add(new Coordinate2D(3, 8.5));
    Polyline linePl = PolylineBuilderEx.CreatePolyline(plCoords);
    
    var arrowInfo = new ArrowInfo()
    {
      ArrowHeadKey = ArrowInfo.DefaultArrowHeadKeys[8],
      ArrowOnBothEnds = true,
      ArrowSizePoints = 24,
      LineWidthPoints = 12
    };
    
    //Create and add element to layout
    GraphicElement lineElm = ElementFactory.Instance.CreateArrowGraphicElement(
      container, linePl, arrowInfo, "Arrow Line", true, 
                                new ElementInfo() { Rotation = 15.0 });
    //lineElm.SetName("New Line");
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also