ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork Namespace / Element Class
Members Example

In This Topic
    Element Class
    In This Topic
    Represents a row inside a utility network.
    Object Model
    Element ClassAssetGroup ClassAssetType ClassNetworkSource ClassTerminal Class
    Syntax
    public sealed class Element : System.IEquatable<Element>  
    Public NotInheritable Class Element 
       Implements System.IEquatable(Of Element) 
    Remarks
    The Element class is used to represent a row inside a utility network.
    • If the row represents a junction with terminals, Element can also specify a terminal.
    • If the row represents a line to be used as a tracing starting point or barrier, the percent along the edge can be specified to specify an exact location.
    Elements can be created using the CreateElement factory methods on the UtilityNetwork class and can be returned with trace results.
    Example
    Fetching a Row from an Element
    // usage :   using (var row = FetchRowFromElement(...))
    public static Row FetchRowFromElement(UtilityNetwork utilityNetwork, Element element)
    {
      // Get the table from the element
      using (Table table = utilityNetwork.GetTable(element.NetworkSource))
      {
        // Create a query filter to fetch the appropriate row
        QueryFilter queryFilter = new QueryFilter()
        {
          ObjectIDs = new List<long>() { element.ObjectID }
        };
    
        // Fetch and return the row
        using (RowCursor rowCursor = table.Search(queryFilter))
        {
          if (rowCursor.MoveNext())
          {
            return rowCursor.Current;
          }
          return null;
        }
      }
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.Data.UtilityNetwork.Element

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also