ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Core.Geometry Namespace / EnvelopeBuilderEx Class / CreateEnvelope Method / CreateEnvelope(Coordinate3D,Coordinate3D,SpatialReference) Method
Lower left corner of the envelope.
Upper right corner of the envelope.
(Optional) The SpatialReference. The default value is null.
Example

In This Topic
    CreateEnvelope(Coordinate3D,Coordinate3D,SpatialReference) Method
    In This Topic
    Convenience method to create a new instance of the Envelope class.
    Syntax
    Public Overloads Shared Function CreateEnvelope( _
       ByVal minCoord As Coordinate3D, _
       ByVal maxCoord As Coordinate3D, _
       Optional ByVal spatialReference As SpatialReference _
    ) As Envelope

    Parameters

    minCoord
    Lower left corner of the envelope.
    maxCoord
    Upper right corner of the envelope.
    spatialReference
    (Optional) The SpatialReference. The default value is null.

    Return Value

    An Envelope with HasZ = true.
    Remarks
    The resulting envelope is normalized to ensure its XMin <= XMax, YMin <= YMax, ZMin <= ZMax. If any of the xy-coordinate values are NaN, then the envelope is set to empty.
    Example
    Create Map Frame and Set Camera
    {
      //Create a map frame and set its camera by zooming to the extent of an existing bookmark.
      var project = Project.Current;
      await QueuedTask.Run(() =>
      {
    
      //Build 2D envelope geometry
      Coordinate2D mf_ll = new Coordinate2D(6.0, 8.5);
      Coordinate2D mf_ur = new Coordinate2D(8.0, 10.5);
      Envelope mf_env = EnvelopeBuilderEx.CreateEnvelope(mf_ll, mf_ur);
    
      //Reference map, create MF and add to layout
      MapProjectItem mapPrjItem = project.GetItems<MapProjectItem>()
                           .FirstOrDefault(item => item.Name.Equals("Map"));
      Map mfMap = mapPrjItem.GetMap();
      Bookmark bookmark = mfMap.GetBookmarks().FirstOrDefault(
                            b => b.Name == "Great Lakes");
    
      MapFrame mfElm = ElementFactory.Instance.CreateMapFrameElement(
                           layout, mf_env, mfMap, "New Map Frame");
    
      //Zoom to bookmark
      mfElm.SetCamera(bookmark);
      });
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also