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

In This Topic
    GetAvailableElevationUnitFormats Method
    In This Topic
    Gets the list of available elevation unit formats for the given scene. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetAvailableElevationUnitFormats() As IList(Of DisplayUnitFormat)
    public IList<DisplayUnitFormat> GetAvailableElevationUnitFormats()

    Return Value

    Remarks
    An empty list is returned for any map that is not of type scene
    Example
    Get the Available List of Map Elevation Units
    {
        //If the map is not a scene, the list of current
        //Project distance units will be returned
        //Note: Must be on the QueuedTask.Run()
        var elev_units = map.GetAvailableElevationUnitFormats();
    }
    Set the Elevation Unit for the Current Map
    {
        //Trying to set the elevation unit on a map other than
        //a scene will throw an InvalidOperationException
        if (map.IsScene)
        {
            //Get the list of available elevation unit formats
            //for the current map
            var loc_units = map.GetAvailableElevationUnitFormats();
            //arbitrarily use the last unit in the list
            //Note: Must be on the QueuedTask.Run()
            map.SetElevationUnitFormat(loc_units.Last());
        }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also