ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMLineGraphic Class
Members Example

In This Topic
    CIMLineGraphic Class
    In This Topic
    Represents a line graphic.
    Object Model
    CIMLineGraphic ClassCIMLineGraphic ClassCIMLineGraphic ClassPolyline ClassCIMSymbolReference Class
    Syntax
    Example
    Line Graphic Element using CIMGraphic
    //On the QueuedTask
    //Place a line symbol using the extent's lower left and upper right corner.
    var extent = MapView.Active.Extent;
    //get the lower left corner of the extent
    var pointFromCoordinates = new Coordinate2D(extent.XMin, extent.YMin);
    //get the upper right corner of the extent
    var pointToCoordinates = new Coordinate2D(extent.XMax, extent.YMax);
    List<Coordinate2D> points = new List<Coordinate2D> { pointFromCoordinates, pointToCoordinates };
    //create the polyline
    var lineSegment = PolylineBuilderEx.CreatePolyline(points);
    
    //specify a symbol
    var line_symbol = SymbolFactory.Instance.ConstructLineSymbol(
                          ColorFactory.Instance.GreenRGB);
    
    //create a CIMGraphic 
    var graphic = new CIMLineGraphic()
    {
      Symbol = line_symbol.MakeSymbolReference(),
      Line = lineSegment,
    };
    graphicsLayer.AddElement(graphic);
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.CIMGraphic
             ArcGIS.Core.CIM.CIMShapeGraphic
                ArcGIS.Core.CIM.CIMLineGraphic

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also