ArcGIS Pro 2.6 API Reference Guide
ShapePreservingLength Method (GeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > GeometryEngine Class : ShapePreservingLength Method
The input geometry.
Calculates the length of the geometry on the surface of the Earth ellipsoid. This method preserves the shape of the geometry in its coordinate system.
Syntax
public double ShapePreservingLength( 
   Geometry geometry
)
Public Function ShapePreservingLength( _
   ByVal geometry As Geometry _
) As Double

Parameters

geometry
The input geometry.

Return Value

Length of the geometry in meters.
Exceptions
ExceptionDescription
Geometry is null or empty.
The method is not implemented for GeometryBag or Multipatch.
Geometry is missing a spatial reference.
Spatial reference of geometryis an image coordinate system.
Remarks
This method preserves the shape of the geometry in its coordinate system. In other words, the length will be calculated for the geometry you see in the map. For example, if you have a polyline with only two vertices that represents the equator, the length returned will be the length of the equator.
Example
// pt
MapPoint pt = MapPointBuilder.CreateMapPoint(1.0, 3.0, SpatialReferences.WebMercator);
double len = GeometryEngine.Instance.ShapePreservingLength(pt);          // len = 0

List<MapPoint> pts = new List<MapPoint>();
pts.Add(MapPointBuilder.CreateMapPoint(1.0, 1.0, 3.0));
pts.Add(MapPointBuilder.CreateMapPoint(1.0, 3.0, 3.0));
pts.Add(MapPointBuilder.CreateMapPoint(3, 3, 3.0));
pts.Add(MapPointBuilder.CreateMapPoint(3.0, 1.0, 3.0));

// multipoint
Multipoint mPt = MultipointBuilder.CreateMultipoint(pts);
len = GeometryEngine.Instance.ShapePreservingLength(mPt);                // len = 0

// polyline
Polyline polyline = PolylineBuilder.CreatePolyline(pts, SpatialReferences.WGS84);
len = GeometryEngine.Instance.ShapePreservingLength(polyline);

// polygon
Polygon polygon = PolygonBuilder.CreatePolygon(pts, SpatialReferences.WGS84);
len = GeometryEngine.Instance.ShapePreservingLength(polygon);
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

GeometryEngine Class
GeometryEngine Members