ArcGIS Pro 2.9 API Reference Guide
TraceArgument Constructor(NamedTraceConfiguration,IReadOnlyList<Element>)
Example 

ArcGIS.Core.Data.UtilityNetwork.Trace Namespace > TraceArgument Class > TraceArgument Constructor : TraceArgument Constructor(NamedTraceConfiguration,IReadOnlyList<Element>)
The trace configuration for the trace.
A set of starting locations from which to originate the trace.
Initializes a new instance of the TraceArgument class using a namedTraceConfiguration and startingLocations.
Syntax

Parameters

namedTraceConfiguration
The trace configuration for the trace.
startingLocations
A set of starting locations from which to originate the trace.
Exceptions
ExceptionDescription

namedTraceConfiguration or startingLocations is null.

-or-

Any ArcGIS.Core.Data.UtilityNetwork.Element in startingLocations is null.

startingLocations is empty.
Example
private void TraceUtilityNetworkUsingNamedTraceConfiguration(UtilityNetwork utilityNetwork, NamedTraceConfiguration namedTraceConfiguration, Element startElement)
{
  // Get the trace manager from the utility network
  using (TraceManager traceManager = utilityNetwork.GetTraceManager())
  {
    // Get a tracer from the trace manager using the named trace configuration
    Tracer upstreamTracer = traceManager.GetTracer(namedTraceConfiguration);
    
    // Trace argument holding the trace input parameters
    TraceArgument upstreamTraceArgument = new TraceArgument(namedTraceConfiguration, new List<Element> {startElement});
    
    // Trace results 
    IReadOnlyList<Result> upstreamTraceResults = upstreamTracer.Trace(upstreamTraceArgument);
  }
}
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

TraceArgument Class
TraceArgument Members
Overload List