ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork Namespace / SubnetworkExportOptions Class / ResultFieldsByNetworkSourceID Property
Example

In This Topic
    ResultFieldsByNetworkSourceID Property
    In This Topic
    The names of the fields from a network source that will be returned as results.
    Syntax
    public Dictionary<int,List<string>> ResultFieldsByNetworkSourceID {get; set;}
    Public Property ResultFieldsByNetworkSourceID As Dictionary(Of Integer,List(Of String))
    Example
    Export Subnetwork
    {
      // This routine exports a subnetwork to a JSON file
      static void ExportSubnetwork(UtilityNetwork utilityNetwork, string subnetworkName, Uri exportResultJsonPath)
      {
        using UtilityNetworkDefinition utilityNetworkDefinition = utilityNetwork.GetDefinition();
        using SubnetworkManager subnetworkManager = utilityNetwork.GetSubnetworkManager();
        Subnetwork subnetwork = subnetworkManager.GetSubnetwork(subnetworkName);
    
        IReadOnlyList<NetworkAttribute> networkAttributes = utilityNetworkDefinition.GetNetworkAttributes();
        IReadOnlyList<NetworkSource> networkSources = utilityNetworkDefinition.GetNetworkSources();
    
        NetworkSource electricDevice = networkSources.First(f => f.Name.Contains("ElectricDevice"));
    
        // Export options
        SubnetworkExportOptions subnetworkExportOptions = new()
        {
          SetAcknowledged = false,
          IncludeDomainDescriptions = true,
          IncludeGeometry = true,
          ServiceSynchronizationType = ServiceSynchronizationType.Asynchronous,
    
          SubnetworkExportResultTypes = new List<SubnetworkExportResultType>()
          {
            SubnetworkExportResultType.Connectivity,
            SubnetworkExportResultType.Features
          },
    
          ResultNetworkAttributes = new List<NetworkAttribute>(networkAttributes),
    
          ResultFieldsByNetworkSourceID = new Dictionary<int, List<string>>()
            { { electricDevice.ID, new List<string>() { "AssetID" } } }
        };
        subnetwork.Export(exportResultJsonPath, subnetworkExportOptions);
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.2 or higher.
    See Also