ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMGraphicElement Class
Members Example

In This Topic
    CIMGraphicElement Class
    In This Topic
    Represents the CIM representation of an element on a page layout.
    Object Model
    CIMGraphicElement ClassCIMGraphicElement ClassCIMGraphicElement ClassCIMGraphic ClassMapPoint Class
    Syntax
    Example
    Create Graphic Element using CIMGraphic
    //on the QueuedTask
    //Place symbol on the layout
    //At 2.x - MapPoint location = MapPointBuilder.CreateMapPoint(
    //                                               new Coordinate2D(9, 1));
    MapPoint location = MapPointBuilderEx.CreateMapPoint(new Coordinate2D(9, 1));
    
    //specify a symbol
    var pt_symbol = SymbolFactory.Instance.ConstructPointSymbol(
                          ColorFactory.Instance.GreenRGB);
    
    //create a CIMGraphic 
    var graphic = new CIMPointGraphic()
    {
      Symbol = pt_symbol.MakeSymbolReference(),
      Location = location //center of map
    };
    //Or use GraphicFactory
    var graphic2 = GraphicFactory.Instance.CreateSimpleGraphic(location, pt_symbol);
    
    //At 2.x - LayoutElementFactory.Instance.CreateGraphicElement(layout, graphic);
    ElementFactory.Instance.CreateGraphicElement(container, graphic);
    ElementFactory.Instance.CreateGraphicElement(container, graphic2);
    Create Element using a CIMGraphicElement
    //Must be on QueuedTask.Run(() => { ...
    
    //Place symbol on the layout
    //At 2.x - MapPoint point = MapPointBuilder.CreateMapPoint(new Coordinate2D(9, 1));
    MapPoint point = MapPointBuilderEx.CreateMapPoint(new Coordinate2D(9, 1));
    
    //specify a symbol
    var pt_symbol = SymbolFactory.Instance.ConstructPointSymbol(
                          ColorFactory.Instance.GreenRGB);
    
    //create a CIMGraphic 
    var graphic = new CIMGraphicElement()
    {
      Graphic = new CIMPointGraphic()
      {
        Symbol = pt_symbol.MakeSymbolReference(),
        Location = point //A point in the layout
      }
    };
    //At 2.x - LayoutElementFactory.Instance.CreateElement(layout, graphic);
    ElementFactory.Instance.CreateElement(container, graphic);
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.CIMElement
             ArcGIS.Core.CIM.CIMGraphicElement
                ArcGIS.Core.CIM.CIMVideoGraphicElement

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also