ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TinLayer Class / GetSurfaceLength Method / GetSurfaceLength(Multipart,SurfaceInterpolationMethod) Method
The multipart to calculate the 3D length for.
The method of interpolation. The default method of interpolation for TINs is SurfaceInterpolationMethod.Linear.
Example

In This Topic
    GetSurfaceLength(Multipart,SurfaceInterpolationMethod) Method
    In This Topic
    Gets the 3D length of the multipart by interpolating heights from the surface and calculating the sum of 3D distances between the vertices. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Overloads Function GetSurfaceLength( _
       ByVal multipart As Multipart, _
       ByVal interpolationMethod As SurfaceInterpolationMethod _
    ) As Double

    Parameters

    multipart
    The multipart to calculate the 3D length for.
    interpolationMethod
    The method of interpolation. The default method of interpolation for TINs is SurfaceInterpolationMethod.Linear.

    Return Value

    the 3D length of the multipart.
    Exceptions
    ExceptionDescription
    multipart is null.
    An exception occurred within the GetSurfaceLength calculation.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    Portions of the multipart falling outside the interpolation zone are excluded from the calculation.

    See also GetSurfaceLength(Multipart,SurfaceInterpolationMethod,Double,Double) if you wish to specify specific values for densification of the geometry before interpolation occurs depending upon your interpolation method.

    Example
    Get 3D length of multipart by interpolating heights
    var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
    await QueuedTask.Run(() =>
    {
      // interpolate heights and calculate the sum of 3D distances between the vertices
      double length3d = tinLayer.GetSurfaceLength(polygon, SurfaceInterpolationMethod.NaturalNeighbor);
    
      // or use a different interpolation method
      length3d = tinLayer.GetSurfaceLength(polyline, SurfaceInterpolationMethod.NaturalNeighborZNearest);
    
    
      // densify the shape before interpolating
      length3d = tinLayer.GetSurfaceLength(polygon, SurfaceInterpolationMethod.NaturalNeighbor, 0.01, 0);
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.4 or higher.
    See Also