ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / GetDefaultExtent Method
Example

In This Topic
    GetDefaultExtent Method
    In This Topic
    Returns the default full extent of the map. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public Envelope GetDefaultExtent()
    Public Function GetDefaultExtent() As Envelope

    Return Value

    An ArcGIS.Core.Internal.CIM.Envelope representing the default extent
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Calculate Selection tolerance in map units
    //Selection tolerance for the map in pixels
    var selectionTolerance = SelectionEnvironment.SelectionTolerance;
    QueuedTask.Run(() =>
    {
      //Get the map center
      var mapExtent = MapView.Active.Map.GetDefaultExtent();
      var mapPoint = mapExtent.Center;
      //Map center as screen point
      var screenPoint = MapView.Active.MapToScreen(mapPoint);
      //Add selection tolerance pixels to get a "radius".
      var radiusScreenPoint = new System.Windows.Point((screenPoint.X + selectionTolerance), screenPoint.Y);
      var radiusMapPoint = MapView.Active.ScreenToMap(radiusScreenPoint);
      //Calculate the selection tolerance distance in map uints.
      var searchRadius = GeometryEngine.Instance.Distance(mapPoint, radiusMapPoint);
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also