This document is archived and information here might be outdated.  Recommended version.


Set M Value on Point Snippet (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference

Set M Value on Point Snippet

Set a point's MAware to true and assign it a M value.

[C#]
///<summary>Set a point's MAware to true and assign it a M value.</summary>
///  
///<param name="point">An IPoint interface that is the point to enable M values.</param>
///<param name="mValue">A System.Double that is the points M value in map units.</param>
///   
///<remarks></remarks>
public void SetMValueOnPoint(ESRI.ArcGIS.Geometry.IPoint point, System.Double mValue)
{
  ESRI.ArcGIS.Geometry.IMAware mAware=point as ESRI.ArcGIS.Geometry.IMAware; // Dynamic Cast
  mAware.MAware=true;
  point.M=mValue;
}
[Visual Basic .NET]
'''<summary>Set a point's MAware to true and assign it a M value.</summary>
'''  
'''<param name="point">An IPoint interface that is the point to enable M values.</param>
'''<param name="mValue">A System.Double that is the points M value in map units.</param>
'''   
'''<remarks></remarks>
Public Sub SetMValueOnPoint(ByVal point As ESRI.ArcGIS.Geometry.IPoint, ByVal mValue As System.Double)

  Dim mAware As ESRI.ArcGIS.Geometry.IMAware=TryCast(point, ESRI.ArcGIS.Geometry.IMAware) ' Dynamic Cast
  mAware.MAware=True
  point.M=mValue

End Sub

Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.Geometry
  • ESRI.ArcGIS.System