ArcGIS Pro 2.9 API Reference Guide
Length Method (GeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > GeometryEngine Class : Length Method
The input geometry.
Gets the length for a specified geometry. This is a planar measurement using 2D Cartesian mathematics.
Syntax
public double Length( 
   Geometry geometry
)
Public Function Length( _
   ByVal geometry As Geometry _
) As Double

Parameters

geometry
The input geometry.

Return Value

The calculated length in the same units as the geometry's spatial reference unit. If the geometry is empty, then zero is returned.
Exceptions
ExceptionDescription
Geometry is null.
The method is not implemented for GeometryBag or Multipatch.
Example
MapPoint c1 = MapPointBuilder.CreateMapPoint(1, 2, 3);
MapPoint c2 = MapPointBuilder.CreateMapPoint(4, 2, 4);

// line segment
LineSegment line = LineBuilder.CreateLineSegment(c1, c2);
double len = line.Length;     // = 3
double len3D = line.Length3D;   // = Math.Sqrt(10)

// polyline
Polyline p = PolylineBuilder.CreatePolyline(line);
double p_len = p.Length;        // = len = 3
double p_len3D = p.Length3D;    // = len3D = Math.Sqrt(10)

double ge_len = GeometryEngine.Instance.Length(p);      // = p_len = len = 3
double ge_len3d = GeometryEngine.Instance.Length3D(p);    // = p_len3D = len3D = Math.Sqrt(10)
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

GeometryEngine Class
GeometryEngine Members