Public Sub SetElevationUnitFormat( _ ByVal unitFormat As DisplayUnitFormat _ )
public void SetElevationUnitFormat( DisplayUnitFormat unitFormat )
Parameters
- unitFormat
- The elevation unit format to set
Public Sub SetElevationUnitFormat( _ ByVal unitFormat As DisplayUnitFormat _ )
public void SetElevationUnitFormat( DisplayUnitFormat unitFormat )
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
| System.ArgumentException | unit format is of the wrong type |
| System.ArgumentException | unit format is not in the list of available elevation unit formats |
| System.InvalidOperationException | elevation unit format can only be set on a scene |
{
//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());
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)