ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / GetNormalsAtM Method
The multipart containing the M-values. If the multipart is a polygon, then the boundary is used.
The M-value at which to construct the normal line.
The length of the normal line. A positive value means the normal lines are on the right side of the multipart. A negative value means the normal lines are on the left side of the multipart.
Example

In This Topic
    GetNormalsAtM Method (IGeometryEngine)
    In This Topic
    Gets the line segments corresponding to the normal at the locations along the geometry where the specified M occurs.
    Syntax
    Function GetNormalsAtM( _
       ByVal multipart As Multipart, _
       ByVal mValue As Double, _
       ByVal length As Double _
    ) As Polyline

    Parameters

    multipart
    The multipart containing the M-values. If the multipart is a polygon, then the boundary is used.
    mValue
    The M-value at which to construct the normal line.
    length
    The length of the normal line. A positive value means the normal lines are on the right side of the multipart. A negative value means the normal lines are on the left side of the multipart.

    Return Value

    A polyline. Each part of the polyline is a normal line. If the input multipart is empty, then an empty polyline is returned.
    Exceptions
    ExceptionDescription
    Multipart is null or empty.
    This geometry is not M-Aware.
    Spatial reference of multipartis an image coordinate system.
    Example
    Get line segments corresponding to the normal at the locations where the specified M values occur along the geometry - GetNormalsAtM
    IList<MapPoint> inPoints = new List<MapPoint>()
    {
      MapPointBuilderEx.CreateMapPoint(-3000, -2000, 0, 100),
      MapPointBuilderEx.CreateMapPoint(-3000, 0, 0, 200),
      MapPointBuilderEx.CreateMapPoint(-1000, 0, 0, 300),
      MapPointBuilderEx.CreateMapPoint(-1000, 2000, 0, 100),
      MapPointBuilderEx.CreateMapPoint(3000, 2000, 0, 200),
      MapPointBuilderEx.CreateMapPoint(3000, 0, 0, 300),
      MapPointBuilderEx.CreateMapPoint(1000, 0, 0, 100),
      MapPointBuilderEx.CreateMapPoint(1000, -2000, 0, 200),
      MapPointBuilderEx.CreateMapPoint(-3000, -2000, 0, 300)
    };
    
    Polygon polygon = PolygonBuilderEx.CreatePolygon(inPoints);
    // polygon.HasM = true
    
    Polyline polyline = GeometryEngine.Instance.GetNormalsAtM(polygon, 150, 100);
    // polyline.PartCount = 5
    // polyline.PointCount = 10
    // polyline.HasM = false
    
    ReadOnlyPartCollection parts = polyline.Parts;
    ReadOnlySegmentCollection segments = parts[0];
    LineSegment line = segments[0] as LineSegment;
    // line.StartCoordinate = (-3000, -1000)
    // line.EndCoordinate = (-2900, -1000)
    
    segments = parts[1];
    line = segments[0] as LineSegment;
    // line.StartCoordinate = (-1000, 1500)
    // line.EndCoordinate = (-900, 1500)
    
    segments = parts[2];
    line = segments[0] as LineSegment;
    // line.StartCoordinate = (1000, 2000)
    // line.EndCoordinate = (1000, 1900)
    
    segments = parts[3];
    line = segments[0] as LineSegment;
    // line.StartCoordinate = (1500, 0)
    // line.EndCoordinate = (1500, 100)
    
    segments = parts[4];
    line = segments[0] as LineSegment;
    // line.StartCoordinate = (1000, -1000)
    // line.EndCoordinate = (900, -1000)
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also