ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Layouts Namespace / GraphicElement Class
Members Example

In This Topic
    GraphicElement Class
    In This Topic
    Represents a graphic element on a page layout.
    Object Model
    GraphicElement ClassGraphicElement ClassCoordinate2D StructureEnvelope ClassCIMElement ClassGeometry ClassCIMGraphic ClassIElementContainer Interface
    Syntax
    Remarks

    Graphic elements are a type of Element and include inserted graphic points, lines, or area shapes. PictureElement and TextElement are also a type of graphic element.

    The Graphic property returns a CIM representation of the graphic specific attributes for a GraphicElement. This may provide additional, finer grained properties exposed in the CIM that are not exposed in the managed API. SetGraphic applies the changes made to a modified CIMGraphic back to the GraphicElement.

    The Clone method allows you to duplicate existing graphic elements on your page layout. This can be useful where you may have a variable number of pictures, for example, on each page in the map series. Rather than authoring a layout with all possibilities, a single picture element can be cloned and updated the appropriate number of times to reference a different set of pictures on disk for each page in the series.

    Example
    Create_BezierCurve
    //Create a bezier curve element with a simple line style.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D pt1 = new Coordinate2D(1, 7.5);
      Coordinate2D pt2 = new Coordinate2D(1.66, 8);
      Coordinate2D pt3 = new Coordinate2D(2.33, 7.1);
      Coordinate2D pt4 = new Coordinate2D(3, 7.5);
      //At 2.x - CubicBezierBuilder bez = new CubicBezierBuilder(pt1, pt2, pt3, pt4);
      var bez = new CubicBezierBuilderEx(pt1, pt2, pt3, pt4);
      CubicBezierSegment bezSeg = bez.ToSegment();
      //At 2.x - Polyline bezPl = PolylineBuilder.CreatePolyline(bezSeg);
      Polyline bezPl = PolylineBuilderEx.CreatePolyline(bezSeg);
    
      //Set symbology, create and add element to layout
      CIMLineSymbol lineSym = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.RedRGB, 4.0, SimpleLineStyle.DashDot);
      //At 2.x - GraphicElement bezElm = LayoutElementFactory.Instance.CreateLineGraphicElement(layout, bezPl, lineSym);
      //         bezElm.SetName("New Bezier Curve");
      GraphicElement bezElm = ElementFactory.Instance.CreateGraphicElement(layout, bezPl, lineSym, "New Bezier Curve");
    });
    Create_freehand
    //Create a graphic freehand element with a simple line style.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      List<Coordinate2D> plCoords = new List<Coordinate2D>();
      plCoords.Add(new Coordinate2D(1.5, 10.5));
      plCoords.Add(new Coordinate2D(1.25, 9.5));
      plCoords.Add(new Coordinate2D(1, 10.5));
      plCoords.Add(new Coordinate2D(0.75, 9.5));
      plCoords.Add(new Coordinate2D(0.5, 10.5));
      plCoords.Add(new Coordinate2D(0.5, 1));
      plCoords.Add(new Coordinate2D(0.75, 2));
      plCoords.Add(new Coordinate2D(1, 1));
      //At 2.x - Polyline linePl = PolylineBuilder.CreatePolyline(plCoords);
      Polyline linePl = PolylineBuilderEx.CreatePolyline(plCoords);
    
      //Set symbolology, create and add element to layout
      CIMLineSymbol lineSym = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.BlackRGB, 2.0, SimpleLineStyle.Solid);
      //At 2.x - GraphicElement lineElm = LayoutElementFactory.Instance.CreateLineGraphicElement(layout, linePl, lineSym);
      //         lineElm.SetName("New Freehand"); 
      GraphicElement lineElm = ElementFactory.Instance.CreateGraphicElement(layout, linePl, lineSym, "New Freehand");
    });
    Create_polygon_poly
    //Create a polygon graphic with simple line and fill styles.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      List<Coordinate2D> plyCoords = new List<Coordinate2D>();
      plyCoords.Add(new Coordinate2D(1, 7));
      plyCoords.Add(new Coordinate2D(2, 7));
      plyCoords.Add(new Coordinate2D(2, 6.7));
      plyCoords.Add(new Coordinate2D(3, 6.7));
      plyCoords.Add(new Coordinate2D(3, 6.1));
      plyCoords.Add(new Coordinate2D(1, 6.1));
      //At 2.x - Polygon poly = PolygonBuilder.CreatePolygon(plyCoords);
      Polygon poly = PolygonBuilderEx.CreatePolygon(plyCoords);
    
      //Set symbolology, create and add element to layout
      CIMStroke outline = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.BlueRGB, 2.0, SimpleLineStyle.DashDotDot);
      CIMPolygonSymbol polySym = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.RedRGB, SimpleFillStyle.ForwardDiagonal, outline);
      //At 2.x - GraphicElement polyElm = LayoutElementFactory.Instance.CreatePolygonGraphicElement(layout, poly, polySym);
      //         polyElm.SetName("New Polygon"); 
      GraphicElement polyElm = ElementFactory.Instance.CreateGraphicElement(layout, poly, polySym, "New Polygon");
    });
    Create_polygon_env
    //Create a polygon graphic using an envelope with simple line and fill styles.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build 2D envelope
      Coordinate2D env_ll = new Coordinate2D(1.0, 4.75);
      Coordinate2D env_ur = new Coordinate2D(3.0, 5.75);
      //At 2.x - Envelope env = EnvelopeBuilder.CreateEnvelope(env_ll, env_ur);
      Envelope env = EnvelopeBuilderEx.CreateEnvelope(env_ll, env_ur);
    
      //Set symbolology, create and add element to layout
      CIMStroke outline = SymbolFactory.Instance.ConstructStroke(
        ColorFactory.Instance.BlueRGB, 2.0, SimpleLineStyle.DashDotDot);
      CIMPolygonSymbol polySym = SymbolFactory.Instance.ConstructPolygonSymbol(
        ColorFactory.Instance.RedRGB, SimpleFillStyle.ForwardDiagonal, outline);
      //At 2.x - GraphicElement polyElm =
      //            LayoutElementFactory.Instance.CreatePolygonGraphicElement(layout, env, polySym);
      //         polyElm.SetName("New Polygon");
      GraphicElement polyElm = ElementFactory.Instance.CreateGraphicElement(
        layout, env, polySym, "New Polygon");
    });
    Create_circle
    //Create a circle graphic element using a simple line and fill styles.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D center = new Coordinate2D(2, 4);
      //At 2.x - EllipticArcBuilder eabCir = new EllipticArcBuilder(center, 0.5, esriArcOrientation.esriArcClockwise);
      var eabCir = new EllipticArcBuilderEx(center, 0.5, ArcOrientation.ArcClockwise);
      EllipticArcSegment cir = eabCir.ToSegment();
    
      //Set symbolology, create and add element to layout
      CIMStroke outline = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.BlackRGB, 2.0, SimpleLineStyle.Dash);
      CIMPolygonSymbol circleSym = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.RedRGB, SimpleFillStyle.Solid, outline);
      //At 2.x - GraphicElement cirElm = LayoutElementFactory.Instance.CreateCircleGraphicElement(layout, cir, circleSym);
      //         cirElm.SetName("New Circle");
    
      var polyLine = PolylineBuilderEx.CreatePolyline(cir);
      GraphicElement cirElm = ElementFactory.Instance.CreateGraphicElement(layout, polyLine, circleSym, "New Circle");
    });
    Create_ellipse
    //Create an ellipse graphic with simple line and fill styles.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D center = new Coordinate2D(2, 2.75);
      //At 2.x - EllipticArcBuilder eabElp = new EllipticArcBuilder(center, 0, 1, 0.45, esriArcOrientation.esriArcClockwise);
      var eabElp = new EllipticArcBuilderEx(center, 0, 1, 0.45, ArcOrientation.ArcClockwise);
      EllipticArcSegment ellipse = eabElp.ToSegment();
    
      //Set symbolology, create and add element to layout
      CIMStroke outline = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.GreenRGB, 2.0, SimpleLineStyle.Dot);
      CIMPolygonSymbol ellipseSym = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.GreyRGB, SimpleFillStyle.Vertical, outline);
      //At 2.x - GraphicElement elpElm = LayoutElementFactory.Instance.CreateEllipseGraphicElement(layout, ellipse, ellipseSym);
      //         elpElm.SetName("New Ellipse");
    
      var polyLine = PolylineBuilderEx.CreatePolyline(ellipse);
      GraphicElement elpElm = ElementFactory.Instance.CreateGraphicElement(layout, polyLine, ellipseSym, "New Ellipse");
    });
    Create_lasso
    //Create a graphic lasso element with simple line and fill styles.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      List<Coordinate2D> plyCoords = new List<Coordinate2D>();
      plyCoords.Add(new Coordinate2D(1, 1));
      plyCoords.Add(new Coordinate2D(1.25, 2));
      plyCoords.Add(new Coordinate2D(1.5, 1.1));
      plyCoords.Add(new Coordinate2D(1.75, 2));
      plyCoords.Add(new Coordinate2D(2, 1.1));
      plyCoords.Add(new Coordinate2D(2.25, 2));
      plyCoords.Add(new Coordinate2D(2.5, 1.1));
      plyCoords.Add(new Coordinate2D(2.75, 2));
      plyCoords.Add(new Coordinate2D(3, 1));
      //At 2.x - Polygon poly = PolygonBuilder.CreatePolygon(plyCoords);
      Polygon poly = PolygonBuilderEx.CreatePolygon(plyCoords);
    
      //Set symbolology, create and add element to layout
      CIMStroke outline = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.BlackRGB, 2.0, SimpleLineStyle.Solid);
      CIMPolygonSymbol polySym = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.RedRGB, SimpleFillStyle.ForwardDiagonal, outline);
      //At 2.x - GraphicElement polyElm = LayoutElementFactory.Instance.CreatePolygonGraphicElement(layout, poly, polySym);
      //         polyElm.SetName("New Lasso"); 
      GraphicElement polyElm = ElementFactory.Instance.CreateGraphicElement(layout, poly, polySym, "New Lasso");
    });
    Create_CurveText
    //Create curve text with basic text properties.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D pt1 = new Coordinate2D(3.6, 7.5);
      Coordinate2D pt2 = new Coordinate2D(4.26, 8);
      Coordinate2D pt3 = new Coordinate2D(4.93, 7.1);
      Coordinate2D pt4 = new Coordinate2D(5.6, 7.5);
      //At 2.x - CubicBezierBuilder bez = new CubicBezierBuilder(pt1, pt2, pt3, pt4);
      var bez = new CubicBezierBuilderEx(pt1, pt2, pt3, pt4);
      CubicBezierSegment bezSeg = bez.ToSegment();
      //At 2.x - Polyline bezPl = PolylineBuilder.CreatePolyline(bezSeg);
      Polyline bezPl = PolylineBuilderEx.CreatePolyline(bezSeg);
    
      //Set symbolology, create and add element to layout
      CIMTextSymbol sym = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlackRGB, 24, "Comic Sans MS", "Regular");
      //At 2.x - GraphicElement bezTxtElm = LayoutElementFactory.Instance.CreateCurvedTextGraphicElement(layout, bezPl, "Curved Text", sym);
      //         bezTxtElm.SetName("New Splinned Text");
      GraphicElement bezTxtElm = ElementFactory.Instance.CreateTextGraphicElement(
                                    layout, TextType.SplinedText, bezPl, sym, "Curved Text", "New Splinned Text");
    });
    Create_PolygonText
    //Create polygon paragraph text with basic text properties.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      List<Coordinate2D> plyCoords = new List<Coordinate2D>();
      plyCoords.Add(new Coordinate2D(3.5, 7));
      plyCoords.Add(new Coordinate2D(4.5, 7));
      plyCoords.Add(new Coordinate2D(4.5, 6.7));
      plyCoords.Add(new Coordinate2D(5.5, 6.7));
      plyCoords.Add(new Coordinate2D(5.5, 6.1));
      plyCoords.Add(new Coordinate2D(3.5, 6.1));
      //At 2.x - Polygon poly = PolygonBuilder.CreatePolygon(plyCoords);
      Polygon poly = PolygonBuilderEx.CreatePolygon(plyCoords);
    
      //Set symbolology, create and add element to layout
      CIMTextSymbol sym = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.GreyRGB, 10, "Arial", "Regular");
      string text = "Some Text String that is really long and is <BOL>forced to wrap to other lines</BOL> so that we can see the effects." as String;
      //At 2.x - GraphicElement polyTxtElm = LayoutElementFactory.Instance.CreatePolygonParagraphGraphicElement(layout, poly, text, sym);
      //         polyTxtElm.SetName("New Polygon Text"); 
      GraphicElement polyTxtElm = ElementFactory.Instance.CreateTextGraphicElement(
                                    layout, TextType.RectangleParagraph, poly, sym, text, "New Polygon Text");
    
      //(Optionally) Modify paragraph border 
      CIMGraphic polyTxtGra = polyTxtElm.GetGraphic();
      CIMParagraphTextGraphic cimPolyTxtGra = polyTxtGra as CIMParagraphTextGraphic;
      cimPolyTxtGra.Frame.BorderSymbol = new CIMSymbolReference();
      cimPolyTxtGra.Frame.BorderSymbol.Symbol = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.GreyRGB, 1.0, SimpleLineStyle.Solid);
      polyTxtElm.SetGraphic(polyTxtGra);
    });
    
    Create_CircleText
    //Create circle paragraph text with basic text settings and optionally a modified border.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D center = new Coordinate2D(4.5, 4);
      //At 2.x - EllipticArcBuilder eabCir = new EllipticArcBuilder(center, 0.5, esriArcOrientation.esriArcClockwise);
      var eabCir = new EllipticArcBuilderEx(center, 0.5, ArcOrientation.ArcClockwise);
      EllipticArcSegment cir = eabCir.ToSegment();
      var polyCir = PolygonBuilderEx.CreatePolygon(
                      PolylineBuilderEx.CreatePolyline(cir));
    
      //Set symbolology, create and add element to layout
      CIMTextSymbol sym = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.GreenRGB, 10, "Arial", "Regular");
      string text = "Circle, circle, circle, circle, circle, circle, circle, circle, circle, circle, circle";
      //At 2.x - GraphicElement cirTxtElm = LayoutElementFactory.Instance.CreateCircleParagraphGraphicElement(layout, cir, text, sym);
      //         cirTxtElm.SetName("New Circle Text");
      GraphicElement cirTxtElm = ElementFactory.Instance.CreateTextGraphicElement(
                                    layout, TextType.CircleParagraph, polyCir, sym, text, "New Circle Text");
    
      //(Optionally) Modify paragraph border 
      CIMGraphic cirTxtGra = cirTxtElm.GetGraphic();
      CIMParagraphTextGraphic cimCirTxtGra = cirTxtGra as CIMParagraphTextGraphic;
      cimCirTxtGra.Frame.BorderSymbol = new CIMSymbolReference();
      cimCirTxtGra.Frame.BorderSymbol.Symbol = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.GreyRGB, 1.0, SimpleLineStyle.Solid);
      cirTxtElm.SetGraphic(cirTxtGra);
    });
    Create_EllipseText
    //Create ellipse paragraph text with basic text settings and optionally a modified border.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D center = new Coordinate2D(4.5, 2.75);
      //At 2.x - EllipticArcBuilder eabElp = new EllipticArcBuilder(center, 0, 1, 0.45, esriArcOrientation.esriArcClockwise);
      var eabElp = new EllipticArcBuilderEx(center, 0, 1, 0.45, ArcOrientation.ArcClockwise);
      EllipticArcSegment ellipse = eabElp.ToSegment();
      var polyElp = PolygonBuilderEx.CreatePolygon(
                      PolylineBuilderEx.CreatePolyline(ellipse));
    
      //Set symbolology, create and add element to layout
      CIMTextSymbol sym = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlueRGB, 10, "Arial", "Regular");
      string text = "Ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse";
      //At 2.x - GraphicElement elpTxtElm = LayoutElementFactory.Instance.CreateEllipseParagraphGraphicElement(layout, ellipse, text, sym);
      //         elpTxtElm.SetName("New Ellipse Text");
      GraphicElement elpTxtElm = ElementFactory.Instance.CreateTextGraphicElement(
                                    layout, TextType.EllipseParagraph, polyElp, sym, text, "New Ellipse Text");
    
      //(Optionally) Modify paragraph border 
      CIMGraphic elpTxtGra = elpTxtElm.GetGraphic();
      CIMParagraphTextGraphic cimElpTxtGra = elpTxtGra as CIMParagraphTextGraphic;
      cimElpTxtGra.Frame.BorderSymbol = new CIMSymbolReference();
      cimElpTxtGra.Frame.BorderSymbol.Symbol = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.GreyRGB, 1.0, SimpleLineStyle.Solid);
      elpTxtElm.SetGraphic(elpTxtGra);
    });
    CIMGraphic
    //This example references a graphic element on a layout and sets its Transparency property (which is not available in the managed API)
    //by accessing the element's CIMGraphic.
    
    //Added references
    using ArcGIS.Core.CIM;                             //CIM
    using ArcGIS.Desktop.Core;                         //Project
    using ArcGIS.Desktop.Layouts;                      //Layout class
    using ArcGIS.Desktop.Framework.Threading.Tasks;    //QueuedTask
    
    public class GraphicElementExample1
    {
      public static Task<bool> UpdateElementTransparencyAsync(string LayoutName, string ElementName, int TransValue)
      {
        //Reference a layoutitem in a project by name
        LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(LayoutName));
        if (layoutItem == null)
          return Task.FromResult(false);
    
        return QueuedTask.Run<bool>(() =>
        {
          //Reference and load the layout associated with the layout item
          Layout lyt = layoutItem.GetLayout();
    
          //Reference a element by name
          GraphicElement graElm = lyt.FindElement(ElementName) as GraphicElement;
          if (graElm == null)
            return false;
    
          //Modify the Transparency property that exists only in the CIMGraphic class.
          CIMGraphic CIMGra = graElm.GetGraphic() as CIMGraphic;
          CIMGra.Transparency = TransValue;             //e.g., TransValue = 50
          graElm.SetGraphic(CIMGra);
    
          return true;
        });
      }
    }
    CloneGraphic
    //This example finds a layout element by name and clones it a specified number of times and applies an accumlative offset for each 
    //cloned element.
    
    //Added references
    using ArcGIS.Core.CIM;                             //CIM
    using ArcGIS.Desktop.Core;                         //Project
    using ArcGIS.Desktop.Layouts;                      //Layout class
    using ArcGIS.Desktop.Framework.Threading.Tasks;    //QueuedTask
    
    public class GraphicElementExample2
    {
      public static Task<bool> CloneElementAsync(string LayoutName, string ElementName, double offset, int numCopies)
      {
        //Reference a layoutitem in a project by name
        LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(LayoutName));
        if (layoutItem == null)
          return Task.FromResult(false);
    
        return QueuedTask.Run<bool>(() =>
        {
          //Reference and load the layout associated with the layout item
          Layout lyt = layoutItem.GetLayout();
    
          //Reference a element by name
          GraphicElement graElm = lyt.FindElement(ElementName) as GraphicElement;
          if (graElm == null)
            return false;
    
          //Loop through the number of copies, clone, and set the offsets for each new element
          double orig_offset = offset;
          while (numCopies != 0)
          {
            GraphicElement cloneElm = graElm.Clone("Clone");
            cloneElm.SetX(cloneElm.GetX() + offset);
            cloneElm.SetY(cloneElm.GetY() - offset);
            offset = offset + orig_offset;
            numCopies = numCopies - 1;
          }
    
          return true;
        });
      }
    }
    Create rectangle graphic with simple symbology
    //Create a simple 2D rectangle graphic and apply simple fill and
    //outline symbols.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build 2D envelope geometry
      Coordinate2D rec_ll = new Coordinate2D(1.0, 4.75);
      Coordinate2D rec_ur = new Coordinate2D(3.0, 5.75);
      //At 2.x - Envelope rec_env = EnvelopeBuilder.CreateEnvelope(rec_ll, rec_ur);
      Envelope rec_env = EnvelopeBuilderEx.CreateEnvelope(rec_ll, rec_ur);
    
      //Set symbolology, create and add element to layout
      CIMStroke outline = SymbolFactory.Instance.ConstructStroke(
        ColorFactory.Instance.BlackRGB, 5.0, SimpleLineStyle.Solid);
      CIMPolygonSymbol polySym = SymbolFactory.Instance.ConstructPolygonSymbol(
        ColorFactory.Instance.GreenRGB, SimpleFillStyle.DiagonalCross, outline);
    
      //At 2.x - GraphicElement recElm =
      //           LayoutElementFactory.Instance.CreateRectangleGraphicElement(
      //                                                  layout, rec_env, polySym);
      //         recElm.SetName("New Rectangle");
      //
      GraphicElement recElm = ElementFactory.Instance.CreateGraphicElement(
        container, rec_env, polySym, "New Rectangle");
      //Or use Predefined shape
      GraphicElement recElm2 = ElementFactory.Instance.CreatePredefinedShapeGraphicElement(
                                container, PredefinedShape.Rectangle, rec_env, polySym, 
                                "New Rectangle2");
    });
    Find layout elements
    //on the QueuedTask
    //Find elements by name
    var layoutElementsToFind = layout.FindElements(new List<string>() { "Point 1", "Line 3", "Text 1" });
    //Get the collection of elements from the page layout. Nesting within GroupElement is preserved.
    var elementCollection = layout.GetElements();
    //Get the collection of Element from the page layout as a flattened list. Nested groups within GroupElement are not preserved.
    var elements = layout.GetElementsAsFlattenedList();
    //Convert collection of the elements to a collection of GraphicElements.
    var graphicElements = elements.ToList().ConvertAll(x => (GraphicElement)x);
    //Find elements by type
    //Find all point graphics in the Layout
    var pointGraphics = graphicElements.Where(elem => elem.GetGraphic() is CIMPointGraphic);
    //Find all line graphics in the Graphics Layer
    var lineGraphics = graphicElements.Where(elem => elem.GetGraphic() is CIMLineGraphic);
    ////Find all polygon graphics in the Graphics Layer
    var polyGraphics = graphicElements.Where(elem => elem.GetGraphic() is CIMPolygonGraphic);
    ////Find all text graphics in the Graphics Layer
    var textGraphics = graphicElements.Where(elem => elem.GetGraphic() is CIMTextGraphic);
    ////Find all picture graphics in the Graphics Layer
    var pictureGraphic = graphicElements.Where(elem => elem.GetGraphic() is CIMPictureGraphic);
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Layouts.Element
             ArcGIS.Desktop.Layouts.GraphicElement
                ArcGIS.Desktop.Layouts.PictureElement
                ArcGIS.Desktop.Layouts.TextElement

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also