GetAvailableLocationUnitFormats Method
Gets the list of available map location unit formats for the given map.
This method must be called on the MCT. Use QueuedTask.Run.
Get the Available List of Map Location Units
//var map = MapView.Active.Map;
//Must be on the QueuedTask.Run()
//Linear location unit formats are not included if the map sr
//is geographic.
var loc_units = map.GetAvailableLocationUnitFormats();
Set the Location Unit for the Current Map
var mv = MapView.Active;
var map = mv.Map;
QueuedTask.Run(() =>
{
//Get the list of available location unit formats
//for the current map
var loc_units = map.GetAvailableLocationUnitFormats();
//arbitrarily use the last unit in the list
map.SetLocationUnitFormat(loc_units.Last());
});
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.