ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ElevationProfileGraph Class / ExportToCSV Method
The file to export the elevation profile information to
Example

In This Topic
    ExportToCSV Method
    In This Topic
    Exports the current elevation profile to a CSV file. Use the CanExport function prior to calling this method to ensure that the elevation profile calculation has completed.
    Syntax
    Public Sub ExportToCSV( _
       ByVal fileName As String _
    ) 
    public void ExportToCSV( 
       string fileName
    )

    Parameters

    fileName
    The file to export the elevation profile information to
    Exceptions
    ExceptionDescription
    fileName cannot be null.
    The fileName does not have a .csv extension or the elevation profile calculation has not completed.
    Example
    Export Elevation Profile Graph
    {
    
        var elevProfileGraph = MapView.Active.GetElevationProfileGraph();
        // Elevation profile graph will be null if no profile graph is displayed
        if (elevProfileGraph == null)
            return;
    
        if (elevProfileGraph.CanExport)
        {
            elevProfileGraph.ExportToImage("c:\\temp\\myprofileImage.png");
            elevProfileGraph.ExportToCSV("c:\\temp\\myprofile.csv");
        }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.5 or higher.
    See Also