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

In This Topic
    GetSubnetworkManager Method
    In This Topic
    Gets a SubnetworkManager object that can be used to query and edit subnetworks. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function GetSubnetworkManager() As SubnetworkManager
    public SubnetworkManager GetSubnetworkManager()

    Return Value

    A SubnetworkManager object that can be used to query and edit subnetworks.
    Exceptions
    ExceptionDescription
    A geodatabase-related exception has occurred.
    This method or property must be called within the lambda passed to QueuedTask.Run
    Remarks
    In file and mobile geodatabases, the SubnetworkManager object returned by this method should not be reused after any edits in the utility network. In the event of edits, a new SubnetworkManager object should be created and used to manage the subnetworks, e.g. update the subnetwork.
    Example
    Update all dirty subnetworks in a tier
    {
      // This routine updates all dirty subnetworks in a given tier and refreshes the map view
      static void UpdateAllDirtySubnetworks(UtilityNetwork utilityNetwork, Tier tier, MapView mapView)
      {
        using SubnetworkManager subnetworkManager = utilityNetwork.GetSubnetworkManager();
        subnetworkManager.UpdateAllSubnetworks(tier, true);
    
        mapView.Redraw(true);
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also