ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / ClearElevationSurfaceLayers Method
Example

In This Topic
    ClearElevationSurfaceLayers Method
    In This Topic
    Will remove all elevation surfaces from the map with the exception of Ground. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Sub ClearElevationSurfaceLayers() 
    public void ClearElevationSurfaceLayers()
    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    The Ground surface cannot be removed.
    On success, an undo-able operation is added to the current operation manager undo stack
    Example
    Remove elevation surface layers
    {
        //Ground will not be removed
        map.ClearElevationSurfaceLayers();
        ElevationSurfaceLayer surfaceLayer = map.GetElevationSurfaceLayers().FirstOrDefault(l => l.Name == "Surface2");
        //Cannot remove ground
        map.RemoveLayer(surfaceLayer);
        //Ground will not be removed
        map.RemoveLayers(map.GetElevationSurfaceLayers());
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also