This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Set Z Value on Point Snippet (ArcObjects .NET 10.4 SDK) |
Set a point's ZAware to true and assign it a Z value.
///<summary>Set a point's ZAware to true and assign it a Z value.</summary> /// ///<param name="point">An IPoint interface that is the point to enable Z values.</param> ///<param name="zValue">A System.Double that is the points Z value in map units.</param> /// ///<remarks></remarks> public void SetZValueOnPoint(ESRI.ArcGIS.Geometry.IPoint point, System.Double zValue) { if(point == null || point.IsEmpty) { return; } ESRI.ArcGIS.Geometry.IZAware zAware=(ESRI.ArcGIS.Geometry.IZAware)(point); // Explicit Cast zAware.ZAware=true; point.Z=zValue; }
'''<summary>Set a point's ZAware to true and assign it a Z value.</summary> ''' '''<param name="point">An IPoint interface that is the point to enable Z values.</param> '''<param name="zValue">A System.Double that is the points Z value in map units.</param> ''' '''<remarks></remarks> Public Sub SetZValueOnPoint(ByVal point As ESRI.ArcGIS.Geometry.IPoint, ByVal zValue As System.Double) If point Is Nothing OrElse point.IsEmpty Then Return End If Dim zAware As ESRI.ArcGIS.Geometry.IZAware=CType(point, ESRI.ArcGIS.Geometry.IZAware) ' Explicit Cast zAware.ZAware=True point.Z=zValue End Sub