ArcGIS Pro 2.9 API Reference Guide
MapPointBuilder Constructor(Double,Double,Double,Double,SpatialReference)
Example 

ArcGIS.Core.Geometry Namespace > MapPointBuilder Class > MapPointBuilder Constructor : MapPointBuilder Constructor(Double,Double,Double,Double,SpatialReference)
X coordinate.
Y coordinate.
Z coordinate.
Measure value.
(Optional) The SpatialReference. The default value is null.
Initializes a new instance of the MapPointBuilder class. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public MapPointBuilder( 
   double x,
   double y,
   double z,
   double m,
   SpatialReference spatialReference
)
Public Function New( _
   ByVal x As Double, _
   ByVal y As Double, _
   ByVal z As Double, _
   ByVal m As Double, _
   Optional ByVal spatialReference As SpatialReference _
)

Parameters

x
X coordinate.
y
Y coordinate.
z
Z coordinate.
m
Measure value.
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 MapPointBuilder attribute properties will be HasZ = true, HasM = true, HasID = false.
Example
// Use a builder convenience method or use a builder constructor.

// Builder convenience methods don't need to run on the MCT.
// create a 3d point with M
MapPoint pt = MapPointBuilder.CreateMapPoint(1.0, 2.0, 3.0, 4.0);

MapPoint ptWithM = 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, 4.0))
  {
    // do something with the builder

    ptWithM = mb.ToGeometry();
  }
});

MapPoint clone = ptWithM.Clone() as MapPoint;
MapPoint anotherM = MapPointBuilder.CreateMapPoint(ptWithM);


// builderEx constructors don't need to run on the MCT.
MapPointBuilderEx builderEx = new MapPointBuilderEx(1.0, 2.0, 3.0);
builderEx.HasM = true;
builderEx.M = 4.0;

pt = builderEx.ToGeometry() as MapPoint;


// or another alternative with builderEx constructor
builderEx = new MapPointBuilderEx(1.0, 2.0, true, 3.0, true, 4.0, false, 0);
pt = builderEx.ToGeometry() as MapPoint;


// or use a builderEx convenience method
pt = MapPointBuilderEx.CreateMapPoint(1.0, 2.0, 3.0, 4.0);
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

MapPointBuilder Class
MapPointBuilder Members
Overload List