ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork.Telecom Namespace / UnitIdentifierManager Class / Query Method
A set of equipment containers (UnitIdentifier) to query.
Example

In This Topic
    Query Method
    In This Topic
    Queries the content, UnitRange of an equipment container, such as ports (content) in a switch or slots (container) in a rack. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    containers
    A set of equipment containers (UnitIdentifier) to query.

    Return Value

    A read-only list of UnitQueryResult objects, each describing a container (UnitIdentifier) and its associated UnitRange values.
    Exceptions
    ExceptionDescription
    containers is empty.
    containers is null.
    A geodatabase-related exception has occurred.
    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.7 or higher.
    See Also