ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / ShowElevationProfileGraph Method / ShowElevationProfileGraph(IEnumerable<MapPoint>,ElevationProfileParameters) Method
A collection of points.
The set of profile parameters. If null, the default set of parameters is used.
Example

In This Topic
    ShowElevationProfileGraph(IEnumerable<MapPoint>,ElevationProfileParameters) Method
    In This Topic
    Shows an elevation profile of a collection of points. The calculation is performed according to the profileParameters specified. The profileParameters allows you to specify the elevation surface layer the calculation is performed against along with whether the generated elevation profile line is densified.
    Syntax
    public void ShowElevationProfileGraph( 
       IEnumerable<MapPoint> pts,
       ElevationProfileParameters profileParameters
    )
    Public Overloads Sub ShowElevationProfileGraph( _
       ByVal pts As IEnumerable(Of MapPoint), _
       Optional ByVal profileParameters As ElevationProfileParameters _
    ) 

    Parameters

    pts
    A collection of points.
    profileParameters
    The set of profile parameters. If null, the default set of parameters is used.
    Exceptions
    ExceptionDescription
    Points cannot be null.
    An elevation profile cannot be displayed on the current map.
    The specified profileParameters are invalid.
    The Map does not have a visible Ground Surface Layer.
    The Map does not have the specified surfaceLayer.
    Remarks
    Pass null for the profileParameters if you want to use the default values; that is the Ground Surface layer is used to calculate the Z values and the generated elevation profile line is densified.

    Use the ElevationProfileGraphAdded delegate to determine when the elevation profile graph is added to the mapView. Once this has occurred, MapView.GetElevationProfileGraph will return a non-null ElevationProfileGraph.

    Example
    Show Elevation profile graph with the default ground surface
    if (!MapView.Active.CanShowElevationProfileGraph())
      return;
    
    // show the elevation profile for a polyline 
    // use the default ground surface layer
    MapView.Active.ShowElevationProfileGraph([lineGeom]);
    
    // show the elevation profile for a set of points
    // use the default ground surface layer
    MapView.Active.ShowElevationProfileGraph(pts);
    Show Elevation profile graph with a specific surface
    if (!MapView.Active.CanShowElevationProfileGraph())
      return;
    
    // find a specific elevation surface layer
    var eleLayer = MapView.Active.Map.GetElevationSurfaceLayers().FirstOrDefault(l => l.Name == "TIN");
    
    // set up the parameters
    var profileParams = new ElevationProfileParameters();
    profileParams.SurfaceLayer = eleLayer;
    profileParams.Densify = true;
    
    
    // show the elevation profile for a polyline using the params
    MapView.Active.ShowElevationProfileGraph([lineGeom], profileParams);
    
    // show the elevation profile for a set of points using the params
    MapView.Active.ShowElevationProfileGraph(pts, profileParams);
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.5 or higher.
    See Also