ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / MultipointBuilderEx Class / CreateMultipoint Method / CreateMultipoint(IEnumerable<MapPoint>,AttributeFlags,SpatialReference) Method
The points of the newly created multipoint.
AttributeFlags to set the HasZ, HasM and HasID properties. If no attributes should be set, pass AttributeFlags.None. If all attributes should be set, pass AttributeFlags.AllAttributes. Use the bitwise OR operator to set two attributes. For example, to set HasZ = true and HasM = true, pass AttributeFlags.HasZ | AttributeFlags.HasM. For performance reasons, the attributes of the input points are not used. However, if an attribute is specified, then the attribute values of the input points is used. For example, if AttributeFlags.HasZ is specified, then the Z-values of the input points is used for the newly created multipoint.
(Optional) The spatial reference of the newly created multipoint. The default value is null. For performance reasons, the spatial references of the input points are not checked nor are they used. To avoid undefined behavior, make sure that the spatial references of the input points are compatible or null.
Example Version

CreateMultipoint(IEnumerable<MapPoint>,AttributeFlags,SpatialReference) Method
Convenience method to create an instance of the Multipoint class.
Syntax

Parameters

points
The points of the newly created multipoint.
attributes
AttributeFlags to set the HasZ, HasM and HasID properties. If no attributes should be set, pass AttributeFlags.None. If all attributes should be set, pass AttributeFlags.AllAttributes. Use the bitwise OR operator to set two attributes. For example, to set HasZ = true and HasM = true, pass AttributeFlags.HasZ | AttributeFlags.HasM. For performance reasons, the attributes of the input points are not used. However, if an attribute is specified, then the attribute values of the input points is used. For example, if AttributeFlags.HasZ is specified, then the Z-values of the input points is used for the newly created multipoint.
spatialReference
(Optional) The spatial reference of the newly created multipoint. The default value is null. For performance reasons, the spatial references of the input points are not checked nor are they used. To avoid undefined behavior, make sure that the spatial references of the input points are compatible or null.

Return Value

Exceptions
ExceptionDescription
points is null.
Example
Construct a Multipoint - from an enumeration of MapPoints
// Use a builderEx convenience method or use a builderEx constructor.

List<MapPoint> list = new List<MapPoint>();
list.Add(MapPointBuilderEx.CreateMapPoint(1.0, 1.0));
list.Add(MapPointBuilderEx.CreateMapPoint(1.0, 2.0));
list.Add(MapPointBuilderEx.CreateMapPoint(2.0, 2.0));
list.Add(MapPointBuilderEx.CreateMapPoint(2.0, 1.0));

// use the builderEx constructors which don't need to run on the MCT.
// use AttributeFlags.NoAttributes since we have 2d points in the list
MultipointBuilderEx builderEx = new MultipointBuilderEx(list, AttributeFlags.None);
Multipoint multiPoint = builderEx.ToGeometry() as Multipoint;
int ptCount = builderEx.PointCount;

// builderEx convenience methods don't need to run on the MCT
multiPoint = MultipointBuilderEx.CreateMultipoint(list);
// multiPoint.HasZ, HasM, HasID will be false - the attributes are determined 
//    based on the attribute state of the points in the list

// or specifically set the state
multiPoint = MultipointBuilderEx.CreateMultipoint(list, AttributeFlags.None);
// multiPoint.HasM = false

multiPoint = MultipointBuilderEx.CreateMultipoint(list, AttributeFlags.HasM);
// multiPoint.HasM = true

ptCount = multiPoint.PointCount;
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also