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

ArcGIS.Core.Geometry Namespace > MapPointBuilder Class > CreateMapPoint Method : CreateMapPoint(Double,Double,SpatialReference) Method
X coordinate.
Y coordinate.
(Optional) The SpatialReference. The default value is null.
Convenience method to quickly create a MapPoint instance.
Syntax
public static MapPoint CreateMapPoint( 
   double x,
   double y,
   SpatialReference spatialReference
)
Public Overloads Shared Function CreateMapPoint( _
   ByVal x As Double, _
   ByVal y As Double, _
   Optional ByVal spatialReference As SpatialReference _
) As MapPoint

Parameters

x
X coordinate.
y
Y coordinate.
spatialReference
(Optional) The SpatialReference. The default value is null.

Return Value

Example
// Use a builder convenience method or use a builder constructor.

MapPoint startPt = MapPointBuilder.CreateMapPoint(1.0, 1.0);
MapPoint endPt = MapPointBuilder.CreateMapPoint(2.0, 1.0);

List<MapPoint> list = new List<MapPoint>();
list.Add(startPt);
list.Add(endPt);

// Builder convenience methods don't need to run on the MCT.
Polyline polyline = PolylineBuilder.CreatePolyline(list, SpatialReferences.WGS84);

// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
  using (PolylineBuilder pb = new PolylineBuilder(list))
  {
    pb.SpatialReference = SpatialReferences.WGS84;
    Polyline polyline2 = pb.ToGeometry();
  }
});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

MapPointBuilder Class
MapPointBuilder Members
Overload List