GetAvailableElevationUnitFormats Method
Gets the list of available elevation unit formats for the given scene.
This method must be called on the MCT. Use QueuedTask.Run.
Get the Available List of Map Elevation Units
//var map = MapView.Active.Map;
//Must be on the QueuedTask.Run()
//If the map is not a scene, the list of current
//Project distance units will be returned
var elev_units = map.GetAvailableElevationUnitFormats();
Set the Elevation Unit for the Current Map
var map = MapView.Active.Map;
QueuedTask.Run(() =>
{
//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
map.SetElevationUnitFormat(loc_units.Last());
}
});
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.