ArcGIS Pro 2.8 API Reference Guide
CreateEnvelope(Envelope,SpatialReference) Method
Example 

ArcGIS.Core.Geometry Namespace > EnvelopeBuilder Class > CreateEnvelope Method : CreateEnvelope(Envelope,SpatialReference) Method
The Envelope that will be copied.
(Optional) The SpatialReference. The default value is null. If spatialReference is null, then the spatial reference is inherited from envelope.
Convenience method to create a new instance of the Envelope class.
Syntax
public static Envelope CreateEnvelope( 
   Envelope envelope,
   SpatialReference spatialReference
)
Public Overloads Shared Function CreateEnvelope( _
   ByVal envelope As Envelope, _
   Optional ByVal spatialReference As SpatialReference _
) As Envelope

Parameters

envelope
The Envelope that will be copied.
spatialReference
(Optional) The SpatialReference. The default value is null. If spatialReference is null, then the spatial reference is inherited from envelope.

Return Value

Exceptions
ExceptionDescription
envelope is null.
Example
// Use a builder convenience method or use a builder constructor.

MapPoint minPt = MapPointBuilder.CreateMapPoint(1.0, 1.0);
MapPoint maxPt = MapPointBuilder.CreateMapPoint(2.0, 2.0);

// Create an envelope
Envelope env = EnvelopeBuilder.CreateEnvelope(minPt, maxPt);

// Builder convenience methods don't need to run on the MCT.
Polygon polygonFromEnv = PolygonBuilder.CreatePolygon(env);

// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
  using (PolygonBuilder polygonBuilder = new PolygonBuilder(env))
  {
    polygonBuilder.SpatialReference = SpatialReferences.WGS84;
    polygonFromEnv = polygonBuilder.ToGeometry();
  }
});

// builderEx constructors don't need to run on the MCt
PolygonBuilderEx polygonBuilderEx = new PolygonBuilderEx(env);
polygonBuilderEx.SpatialReference = SpatialReferences.WGS84;
polygonFromEnv = polygonBuilderEx.ToGeometry() as Polygon;

// builderEx convenience methods don't need to run on MCT
polygonFromEnv = PolygonBuilderEx.CreatePolygon(env);
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

EnvelopeBuilder Class
EnvelopeBuilder Members
Overload List