ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork.Trace Namespace / NamedTraceConfiguration Class
Members Example

In This Topic
    NamedTraceConfiguration Class
    In This Topic
    The NamedTraceConfiguration object defines a set of input parameters to a tracing operation.
    Syntax
    public class NamedTraceConfiguration 
    Public Class NamedTraceConfiguration 
    Example
    Fetch a named trace configuration by name
    private NamedTraceConfiguration GetNamedTraceConfigurationsByName(UtilityNetwork utilityNetwork, string configurationName = "WaterNetwork")
    {
      // Query to find named trace configurations
      NamedTraceConfigurationQuery namedTraceConfigurationQuery = new NamedTraceConfigurationQuery { Names = new List<string> { configurationName } };
    
      // Get the trace manager from the utility network
      using (TraceManager traceManager = utilityNetwork.GetTraceManager())
      {
        // A set of named trace configurations specified by the named traced configuration query 
        IReadOnlyList<NamedTraceConfiguration> namedTraceConfigurations = traceManager.GetNamedTraceConfigurations(namedTraceConfigurationQuery);
        NamedTraceConfiguration waterConfiguration = namedTraceConfigurations.First(f => f.Description.Equals(configurationName));
    
        return waterConfiguration;
      }
    }
    Fetch named trace configurations from a utility network layer
    private NamedTraceConfiguration GetNamedTraceConfigurationsFromUtilityNetworkLayer(UtilityNetworkLayer utilityNetworkLayer, string configurationName = "WaterNetwork")
    {
      // Get all named trace configurations in the utility network
      IReadOnlyList<NamedTraceConfiguration> namedTraceConfigurations = utilityNetworkLayer.GetNamedTraceConfigurations();
    
      foreach (NamedTraceConfiguration namedTraceConfiguration in namedTraceConfigurations)
      {
        if (namedTraceConfiguration.Name == configurationName)
        {
          return namedTraceConfiguration;
        }
      }
      return null;
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.Data.UtilityNetwork.Trace.NamedTraceConfiguration

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also