ArcGIS Explorer Component Help |
Multipoint..::.GetPoints Method |
Multipoint Class Example See Also |
Gets an enumerable list of copies of all of Points in the Multipoint.
Namespace:
ESRI.ArcGISExplorer.GeometryAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public IList<Point> GetPoints() |
Visual Basic (Declaration) |
---|
Public Function GetPoints As IList(Of Point) |
Return Value
An enumerable list of Points.Examples
The code below shows two alternative ways to iterate through the Points comprising a Multipoint; firstly by using
GetPoint and PointCount to enumerate over each vertex in a Multipoint by point index number, and secondly by using
a foreach (For Each in Visual Basic) statement and the GetPoints method.
The code assumes there is an existing Multipoint called mpt.
Instances of the Point class are fully-qualified to avoid namespace clashes with System.Drawing.Point.
CopyC#
// For an existing single part Multipoint called mpt, GetPoint and PointCount can be used to iterate points by index number. for (int pointIndx = 0; pointIndx < mpt.PointCount; pointIndx++) { // Use GetPoint to get a copy of the specific point. System.Diagnostics.Debug.WriteLine(mpt.GetPoint(pointIndx).ToString()); } // Alternatively, Points can be iterated by using foreach. foreach (ESRI.ArcGISExplorer.Geometry.Point pt in mpt.GetPoints()) { System.Diagnostics.Debug.WriteLine(pt.ToString()); }
CopyVB.NET
' For an existing single part Multipoint called mpt, GetPoint and PointCount can be used to iterate points by index number. Dim pointIndx As Integer = 0 While pointIndx < mpt.PointCount ' Use GetPoint to get a copy of the specific point. System.Diagnostics.Debug.WriteLine(mpt.GetPoint(pointIndx).ToString()) System.Math.Max(System.Threading.Interlocked.Increment(pointIndx), pointIndx - 1) End While ' Alternatively, Points can be iterated by using foreach. For Each pt As ESRI.ArcGISExplorer.Geometry.Point In mpt.GetPoints() System.Diagnostics.Debug.WriteLine(pt.ToString()) Next