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

In This Topic
    CIMMapFrame Class
    In This Topic
    Represents a map frame on a page layout.
    Object Model
    CIMMapFrame ClassCIMAutoCamera ClassCIMMapFrame ClassPolygon ClassCIMMapFrame ClassCIMGraphicFrame ClassMapPoint ClassCIMMapView Class
    Syntax
    Example
    Apply a Background Color to a MapFrame
    //Apply a background color to the map frame element using the CIM.
    
    //Perform on the worker thread
    QueuedTask.Run(() =>
    {
      //Get the layout
      var myLayout = Project.Current.GetItems<LayoutProjectItem>()?.First().GetLayout();
      if (myLayout == null) return;
    
      //Get the map frame in the layout
      MapFrame mapFrame = myLayout.FindElement("New Map Frame") as MapFrame;
      if (mapFrame == null)
      {
        //TODO Handle null mapframe
        return;
      }
    
      //Get the map frame's definition in order to modify the background.
      var mapFrameDefn = mapFrame.GetDefinition() as CIMMapFrame;
    
      //Construct the polygon symbol to use to create a background
      var polySymbol = SymbolFactory.Instance.ConstructPolygonSymbol(
                     ColorFactory.Instance.BlueRGB, SimpleFillStyle.Solid);
    
      //Set the background
      mapFrameDefn.GraphicFrame.BackgroundSymbol =
                                       polySymbol.MakeSymbolReference();
    
      //Set the map frame definition
      mapFrame.SetDefinition(mapFrameDefn);
    });
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CIM.CIMObject
          ArcGIS.Core.CIM.CIMElement
             ArcGIS.Core.CIM.CIMFrameElement
                ArcGIS.Core.CIM.CIMMapFrame

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also