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

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

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    Linear location unit formats are not included in the list of available unit formats if the map spatial reference uses a geographic coordinate system.
    Example
    Get the Available List of Map Location Units
    {
        //Linear location unit formats are not included if the map sr
        //is geographic.
        //Note: Must be on the QueuedTask.Run()
        var loc_units = map.GetAvailableLocationUnitFormats();
    }
    Set the Location Unit for the Current Map
    {
        //Get the list of available location unit formats
        //for the current map
        //Note: Must be on the QueuedTask.Run()
        var loc_units = map.GetAvailableLocationUnitFormats();
    
        //arbitrarily use the last unit in the list
        map.SetLocationUnitFormat(loc_units.Last());
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also