ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / SetClipGeometry Method / SetClipGeometry(Polygon,CIMLineSymbol) Method
The clip polygon
The border symbol to use or null
Example

In This Topic
    SetClipGeometry(Polygon,CIMLineSymbol) Method
    In This Topic
    Set map clipping to the provided clip polygon. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Sub SetClipGeometry( _
       ByVal clipPolygon As Polygon, _
       ByVal border As CIMLineSymbol _
    ) 
    public void SetClipGeometry( 
       Polygon clipPolygon,
       CIMLineSymbol border
    )

    Parameters

    clipPolygon
    The clip polygon
    border
    The border symbol to use or null
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    clipPolygon cannot be null
    Remarks
    If the clip polygon is not in the spatial reference of the map it will be projected. Clipping will be set to ArcGIS.Core.CIM.ClippingMode.CustomShape. If the border symbol is null then the existing ArcGIS.Core.CIM.CIMMap.ClippingAreaBorderSymbol will be used. If ClippingAreaBorderSymbol is also null then a default line symbol will be assigned.
    Example
    Clip Map to the provided clip polygon
    {
        //Note: Run within QueuedTask
        var mapToClip = MapView.Active.Map;
        //A layer to use for the clip extent
        var lyrOfInterest = mapToClip.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(l => l.Name == "TestPoly").FirstOrDefault();
        //Get the polygon to use to clip the map
        var extent = lyrOfInterest.QueryExtent();
        var polygonForClipping = PolygonBuilderEx.CreatePolygon(extent);
        //Clip the map using the layer's extent
        mapToClip.SetClipGeometry(polygonForClipping,
              SymbolFactory.Instance.ConstructLineSymbol(
              SymbolFactory.Instance.ConstructStroke(
                ColorFactory.Instance.BlueRGB, 2.0, SimpleLineStyle.Dash)));
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also