ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork.Trace Namespace / Tracer Class / Trace Method
The input arguments to the trace.
Example

In This Topic
    Trace Method (Tracer)
    In This Topic
    Executes a trace.
    Syntax
    Public MustOverride Function Trace( _
       ByVal traceArgument As TraceArgument _
    ) As IReadOnlyList(Of Result)

    Parameters

    traceArgument
    The input arguments to the trace.

    Return Value

    A IReadOnlyList of concrete Result whose type corresponds to ResultType set in TraceArgument.ResultTypes.
    Exceptions
    Remarks
    Derived implementations may impose stronger preconditions. For example, a concrete Tracer implementation may throw a System.ArgumentException if traceArgument is created using the TraceArgument.TraceArgument Constructor(Subnetwork) constructor when ArcGIS.Core.Data.UtilityNetwork.Subnetwork does not apply to the particular tracer.
    Example
    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, Windows 8.1

    See Also