ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork Namespace / UtilityNetwork Class / GetUnitIdentifierManager Method
Example

In This Topic
    GetUnitIdentifierManager Method
    In This Topic
    Gets a UnitIdentifierManager object that can be used to work with unit identifiers. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetUnitIdentifierManager() As UnitIdentifierManager
    public UnitIdentifierManager GetUnitIdentifierManager()

    Return Value

    The ArcGIS.Core.Data.UtilityNetwork.Telecom.UnitIdentifierManager object to work with unit identifiers.
    Example
    Query the contents of equipment containers in the utility network
    await QueuedTask.Run(() =>
    {
      using (UnitIdentifierManager unitIdentifierManager = utilityNetwork.GetUnitIdentifierManager())
      {
        var networkSource = utilityNetwork.GetDefinition().GetNetworkSource("TelecomDevice");
    
        // Container to query.
        UnitIdentifier containerUnitId = new UnitIdentifier(networkSource, globalID);
    
        // Query the unit identifiers in the container
        IReadOnlyList<UnitQueryResult> unitQueryResults = unitIdentifierManager.Query(new List<UnitIdentifier> { containerUnitId });
    
        // Iterate through the query results
        foreach (UnitQueryResult unitQueryResult in unitQueryResults)
        {
          UnitIdentifier unitIdentifier = unitQueryResult.Container;
          IReadOnlyList<UnitRange> unitsInAContainer = unitQueryResult.UnitRanges;
    
          // Iterate through the unit ranges (contents) in the container
          foreach (UnitRange unitRange in unitsInAContainer)
          {
            UnitIdentifier contentUnitId = unitRange.Content;
            bool isContentGap = unitRange.IsGap; // True if the content is a gap (empty space reserved for installing a larger piece of equipment).
            short? firstUnit = unitRange.FirstUnit;
            short? lastUnit = unitRange.LastUnit;
          }
        }
      }
    
    });
    Requirements

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

    ArcGIS Pro version: 3.6 or higher.
    See Also