int numPoints = 20;
// use the default ground elevation surface
var result = await MapView.Active.Map.GetElevationProfileFromSurfaceAsync(startPt, endPt, numPoints);
if (result.Status == SurfaceZsResultStatus.Ok)
{
var polylineZ = result.Polyline;
// process the polylineZ
}
// use a specific elevation surface
var eleLayer = MapView.Active.Map.GetElevationSurfaceLayers().FirstOrDefault(l => l.Name == "TIN");
result = await MapView.Active.Map.GetElevationProfileFromSurfaceAsync(startPt, endPt, numPoints, eleLayer);
if (result.Status == SurfaceZsResultStatus.Ok)
{
var polylineZ = result.Polyline;
// process the polylineZ
}