ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork.Trace Namespace / NamedTraceConfigurationQuery Class / NamedTraceConfigurationQuery Constructor
Example

In This Topic
    NamedTraceConfigurationQuery Constructor
    In This Topic
    Represents a filter for performing a query to find the desired NamedTraceConfiguration objects.
    Syntax
    public NamedTraceConfigurationQuery()
    Public Function New()
    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;
      }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also