ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / GetClipGeometry Method
Example

In This Topic
    GetClipGeometry Method
    In This Topic
    Get the current map clipping geometry. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public Polygon GetClipGeometry()
    Public Function GetClipGeometry() As Polygon

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    If clipping is set to ArcGIS.Core.CIM.ClippingMode.None or ArcGIS.Core.CIM.ClippingMode.MapSeries null is returned
    If clipping is set to ArcGIS.Core.CIM.ClippingMode.MapExtent the ArcGIS.Core.CIM.CIMMap.CustomFullExtent is returned.
    Otherwise, if clipping is set to ArcGIS.Core.CIM.ClippingMode.CustomShape the custom clip polygon is returned.
    Example
    Get the map clipping geometry
    var map = MapView.Active.Map;
    //If clipping is set to ArcGIS.Core.CIM.ClippingMode.None or ArcGIS.Core.CIM.ClippingMode.MapSeries null is returned
    //If clipping is set to ArcGIS.Core.CIM.ClippingMode.MapExtent the ArcGIS.Core.CIM.CIMMap.CustomFullExtent is returned.
    //Otherwise, if clipping is set to ArcGIS.Core.CIM.ClippingMode.CustomShape the custom clip polygon is returned.
    var poly = map.GetClipGeometry();
    //You can use the polygon returned
    //For example: We make a polygon graphic element and add it to a Graphics Layer.
    var gl = map.GetLayersAsFlattenedList().OfType<GraphicsLayer>().FirstOrDefault();
    if (gl == null) return;
    var polygonSymbol = SymbolFactory.Instance.ConstructPolygonSymbol(CIMColor.CreateRGBColor(255, 255, 0));
    var cimGraphicElement = new CIMPolygonGraphic
    {
      Polygon = poly,
      Symbol = polygonSymbol.MakeSymbolReference()
    };
    gl.AddElement(cimGraphicElement);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also