ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork.Trace Namespace / TraceManager Class / GetTracer Method / GetTracer(NamedTraceConfiguration) Method
The named trace configuration that the output tracer is associated with.
Example

In This Topic
    GetTracer(NamedTraceConfiguration) Method
    In This Topic
    Gets a specific Tracer instance based on the namedTraceConfiguration. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    namedTraceConfiguration
    The named trace configuration that the output tracer is associated with.

    Return Value

    A specific Tracer instance corresponding to the namedTraceConfiguration.
    Exceptions
    ExceptionDescription
    An exception has occurred while creating the tracer.
    This method or property must be called within the lambda passed to QueuedTask.Run
    Example
    Create a DownstreamTracer
    using (TraceManager traceManager = utilityNetwork.GetTraceManager())
    {
      DownstreamTracer downstreamTracer = traceManager.GetTracer<DownstreamTracer>();
    }
    
    Trace a utility network using a named trace configuration
    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

    ArcGIS Pro version: 3 or higher.
    See Also