ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork Namespace / UtilityNetwork Class / GetTable Method
The NetworkSource object to use to return a ArcGIS.Core.Data.Table.
Example Version

GetTable Method (UtilityNetwork)
Returns the ArcGIS.Core.Data.Table that corresponds to a NetworkSource. This method must be called on the MCT. Use QueuedTask.Run
Syntax
public Table GetTable( 
   NetworkSource networkSource
)

Parameters

networkSource
The NetworkSource object to use to return a ArcGIS.Core.Data.Table.

Return Value

A ArcGIS.Core.Data.Table that corresponds to the input NetworkSource.
Exceptions
ExceptionDescription
networkSource is null.
A geodatabase-related exception has occurred.
This method or property must be called within the lambda passed to QueuedTask.Run
Remarks
This routine is often used in conjunction with Element.NetworkSource to fetch ArcGIS.Core.Data.Row objects from Element objects.
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;
    }
  }
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also