ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork Namespace / Element Class / NetworkSource Property
Example

In This Topic
    NetworkSource Property (Element)
    In This Topic
    Gets the NetworkSource (usually a table) that stores the Row represented by the Element.
    Syntax
    Public ReadOnly Property NetworkSource As NetworkSource
    public NetworkSource NetworkSource {get;}
    Example
    Fetching a Row from an Element
    {
      static Row FetchRowFromElement(UtilityNetwork utilityNetwork, Element element)
      {
        // Get the table from the element
        using (Table unTable = 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 = unTable.Search(queryFilter))
          {
            if (rowCursor.MoveNext())
            {
              return rowCursor.Current;
            }
            return null;
          }
        }
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also