ArcGIS Pro 2.9 API Reference Guide
EnvelopeBuilder Constructor(Coordinate2D,Coordinate2D,SpatialReference)
Example 

ArcGIS.Core.Geometry Namespace > EnvelopeBuilder Class > EnvelopeBuilder Constructor : EnvelopeBuilder Constructor(Coordinate2D,Coordinate2D,SpatialReference)
Lower left corner of the envelope.
Upper right corner of the envelope.
(Optional) The SpatialReference. The default value is null.
Initializes a new instance of the EnvelopeBuilder class. This method must be called on the MCT. Use QueuedTask.Run.
Syntax

Parameters

minCoord
Lower left corner of the envelope.
maxCoord
Upper right corner of the envelope.
spatialReference
(Optional) The SpatialReference. The default value is null.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Remarks
The resulting envelope is normalized to ensure its XMin <= XMax and YMin <= YMax. If any of the coordinate values are NaN, then the envelope is set to empty.
Example
Coordinate2D minCoord = new Coordinate2D(1, 3);
Coordinate2D maxCoord = new Coordinate2D(2, 4);

Coordinate2D c1 = new Coordinate2D(0, 5);
Coordinate2D c2 = new Coordinate2D(1, 3);

// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
  using (EnvelopeBuilder builder = new EnvelopeBuilder(minCoord, maxCoord))
  {
    // builder.XMin, YMin, Zmin, MMin  = 1, 3, 0, double.Nan
    // builder.XMax, YMax, ZMax, MMax = 2, 4, 0, double.Nan

    // set XMin.  if XMin > XMax; both XMin and XMax change
    builder.XMin = 6;
    // builder.XMin, YMin, ZMin, MMin  = 6, 3, 0, double.Nan
    // builder.XMax, YMax, ZMax, MMax = 6, 4, 0, double.Nan

    // set XMax
    builder.XMax = 8;
    // builder.XMin, YMin, ZMin, MMin  = 6, 3, 0, double.Nan
    // builder.XMax, YMax, ZMax, MMax = 8, 4, 0, double.Nan

    // set XMax.  if XMax < XMin, both XMin and XMax change
    builder.XMax = 3;
    // builder.XMin, YMin, ZMin, MMin  = 3, 3, 0, double.Nan
    // builder.XMax, YMax, ZMax, MMax = 3, 4, 0, double.Nan

    // set YMin
    builder.YMin = 2;
    // builder.XMin, YMin, ZMin, MMin  = 3, 2, 0, double.Nan
    // builder.XMax, YMax, ZMax, MMax = 3, 4, 0, double.Nan

    // set ZMin.  if ZMin > ZMax, both ZMin and ZMax change
    builder.ZMin = 3;
    // builder.XMin, YMin, ZMin, MMin  = 3, 2, 3, double.Nan
    // builder.XMax, YMax, ZMax, MMax = 3, 4, 3, double.Nan

    // set ZMax.  if ZMax < ZMin. both ZMin and ZMax change
    builder.ZMax = -1;
    // builder.XMin, YMin, ZMin, MMin  = 3, 2, -1, double.Nan
    // builder.XMax, YMax, ZMax, MMax = 3, 4, -1, double.Nan

    builder.SetZCoords(8, -5);
    // builder.XMin, YMin, ZMin, MMin  = 3, 2, -5, double.Nan
    // builder.XMax, YMax, ZMax, MMax = 3, 4, 8, double.Nan


    builder.SetXYCoords(c1, c2);
    // builder.XMin, YMin, ZMin, MMin  = 0, 3, -5, double.Nan
    // builder.XMax, YMax, ZMax, MMax = 1, 5, 8, double.Nan


    builder.HasM = true;
    builder.SetMCoords(2, 5);

    var geom = builder.ToGeometry();
  }
});

// or use the EnvelopeBuilderEx.  This constructor doesn't need to run on the MCT.

EnvelopeBuilderEx builderEx = new EnvelopeBuilderEx(minCoord, maxCoord);
// builderEx.XMin, YMin, Zmin, MMin  = 1, 3, 0, double.Nan
// builderEx.XMax, YMax, ZMax, MMax = 2, 4, 0, double.Nan

// set XMin.  if XMin > XMax; both XMin and XMax change
builderEx.XMin = 6;
// builderEx.XMin, YMin, ZMin, MMin  = 6, 3, 0, double.Nan
// builderEx.XMax, YMax, ZMax, MMax = 6, 4, 0, double.Nan

// set XMax
builderEx.XMax = 8;
// builderEx.XMin, YMin, ZMin, MMin  = 6, 3, 0, double.Nan
// builderEx.XMax, YMax, ZMax, MMax = 8, 4, 0, double.Nan

// set XMax.  if XMax < XMin, both XMin and XMax change
builderEx.XMax = 3;
// builderEx.XMin, YMin, ZMin, MMin  = 3, 3, 0, double.Nan
// builderEx.XMax, YMax, ZMax, MMax = 3, 4, 0, double.Nan

// set YMin
builderEx.YMin = 2;
// builderEx.XMin, YMin, ZMin, MMin  = 3, 2, 0, double.Nan
// builderEx.XMax, YMax, ZMax, MMax = 3, 4, 0, double.Nan

// set ZMin.  if ZMin > ZMax, both ZMin and ZMax change
builderEx.ZMin = 3;
// builderEx.XMin, YMin, ZMin, MMin  = 3, 2, 3, double.Nan
// builderEx.XMax, YMax, ZMax, MMax = 3, 4, 3, double.Nan

// set ZMax.  if ZMax < ZMin. both ZMin and ZMax change
builderEx.ZMax = -1;
// builderEx.XMin, YMin, ZMin, MMin  = 3, 2, -1, double.Nan
// builderEx.XMax, YMax, ZMax, MMax = 3, 4, -1, double.Nan

builderEx.SetZCoords(8, -5);
// builderEx.XMin, YMin, ZMin, MMin  = 3, 2, -5, double.Nan
// builderEx.XMax, YMax, ZMax, MMax = 3, 4, 8, double.Nan


builderEx.SetXYCoords(c1, c2);
// builderEx.XMin, YMin, ZMin, MMin  = 0, 3, -5, double.Nan
// builderEx.XMax, YMax, ZMax, MMax = 1, 5, 8, double.Nan


builderEx.HasM = true;
builderEx.SetMCoords(2, 5);

var geomEx = builderEx.ToGeometry();
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

EnvelopeBuilder Class
EnvelopeBuilder Members
Overload List