ArcGIS Pro 2.7 API Reference Guide
ToGeometry Method (EnvelopeBuilderEx)
Example 

ArcGIS.Core.Geometry Namespace > EnvelopeBuilderEx Class : ToGeometry Method
Returns an Envelope instance representing the current state of the builder.
Syntax
public override Geometry ToGeometry()
Public Overrides NotOverridable Function ToGeometry() As Geometry

Return Value

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);

// Builder convenience methods don't need to run on the MCT.
Envelope envelope = EnvelopeBuilder.CreateEnvelope(minPt, maxPt);

// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
  using (EnvelopeBuilder builder = new EnvelopeBuilder(minPt, maxPt))
  {
    // do something with the builder

    envelope = builder.ToGeometry();
  }
});

// builderEx constructors don't need to run on the MCT.
EnvelopeBuilderEx builderEx = new EnvelopeBuilderEx(minPt, maxPt);
envelope = builderEx.ToGeometry() as Envelope;
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

EnvelopeBuilderEx Class
EnvelopeBuilderEx Members