ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.CIM Namespace / CIMAutoCamera Class / Extent Property
Example

In This Topic
    Extent Property (CIMAutoCamera)
    In This Topic
    Gets or sets the extent for a map frame when using the fixed constraint.
    Syntax
    Public Property Extent As Envelope
    public Envelope Extent {get; set;}
    Example
    SetAutoCameraFixedExtent
    {
      var autoCamera = mapFrame.GetAutoCamera();
      autoCamera.Source = AutoCameraSource.Fixed;
      autoCamera.AutoCameraType = AutoCameraType.Extent;
    
      var mf_extent = mapFrame.GetViewExtent();
    
      var extent = EnvelopeBuilderEx.CreateEnvelope(
        400748.62, 800296.4, 1310669.05, 1424520.74, mapFrame.Map.SpatialReference);
      autoCamera.Extent = extent;
    
      if (mapFrame.ValidateAutoCamera(autoCamera) &&
        !mapFrame.IsMapSeriesMapFrame())
        mapFrame.SetAutoCamera(autoCamera);
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also