ArcGIS Pro 2.7 API Reference Guide
SetValues(Double,Double,Double) Method
Example 

ArcGIS.Core.Geometry Namespace > MapPointBuilder Class > SetValues Method : SetValues(Double,Double,Double) Method
X coordinate.
Y coordinate.
Z coordinate.
Sets the X, Y and Z coordinates. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void SetValues( 
   double x,
   double y,
   double z
)
Public Overloads Sub SetValues( _
   ByVal x As Double, _
   ByVal y As Double, _
   ByVal z As Double _
) 

Parameters

x
X coordinate.
y
Y coordinate.
z
Z coordinate.
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
// Use a builder convenience method or use a builder constructor.

MapPoint point1 = null;
MapPoint point2 = null;

// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
  using (MapPointBuilder mb = new MapPointBuilder(1.0, 2.0, 3.0))
  {
    bool bhasZ = mb.HasZ;          // hasZ = true
    bool bhasM = mb.HasM;          // hasM = false
    bool bhasID = mb.HasID;        // hasID = false

    // do something with the builder

    point1 = mb.ToGeometry();

    // change some of the builder properties
    mb.X = 11;
    mb.Y = 22;
    mb.HasZ = false;
    mb.HasM = true;
    mb.M = 44;
    // create another point
    point2 = mb.ToGeometry();
  }
});

double x = point1.X;                  // x = 1.0
double y = point1.Y;                  // y = 2.0
double z = point1.Z;                  // z = 3.0
double m = point1.M;                  // m = Nan
int ID = point1.ID;                   // ID = 0
bool hasZ = point1.HasZ;              // hasZ = true
bool hasM = point1.HasM;              // hasM = false
bool hasID = point1.HasID;            // hasID = false
bool isEmpty = point1.IsEmpty;        // isEmpty = false

bool isEqual = point1.IsEqual(point2);    // isEqual = false

// Builder convenience methods don't need to run on the MCT.
MapPoint point3 = MapPointBuilder.CreateMapPoint(point1);
x = point3.X;                   // x = 1.0
y = point3.Y;                   // y = 2.0
z = point3.Z;                   // z = 3.0
m = point3.M;                   // m = Nan
ID = point3.ID;                 // ID = 0
hasZ = point3.HasZ;             // hasZ = true
hasM = point3.HasM;             // hasM = false
hasID = point3.HasID;           // hasID = false


// builderEx constructors don't need to run on the MCT.
MapPointBuilderEx builderEx = new MapPointBuilderEx(point1);
x = builderEx.X;              // x = 1.0
y = builderEx.Y;              // y = 2.0
z = builderEx.Z;              // z = 3.0
m = builderEx.M;              // m = Nan
ID = builderEx.ID;            // ID = 0
hasZ = builderEx.HasZ;        // hasZ = true
hasM = builderEx.HasM;        // hasM = false
hasID = builderEx.HasID;      // hasID = false
isEmpty = builderEx.IsEmpty;     // isEmpty = false

MapPoint point4 = builderEx.ToGeometry() as MapPoint;
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

MapPointBuilder Class
MapPointBuilder Members
Overload List