ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.UtilityNetwork.Trace Namespace / CircuitTracer Class / Export Method
The path of a JSON file where the trace results will be exported.
Input parameters to a trace, TraceArgument.
The options that describe how the trace will be exported, TraceExportOptions.
Example

In This Topic
    Export Method (CircuitTracer)
    In This Topic
    Executes a circuit trace and exports the results to a json file.
    Syntax
    Public Overrides NotOverridable Sub Export( _
       ByVal outputJsonPath As Uri, _
       ByVal traceArgument As TraceArgument, _
       ByVal traceExportOptions As TraceExportOptions _
    ) 

    Parameters

    outputJsonPath
    The path of a JSON file where the trace results will be exported.
    traceArgument
    Input parameters to a trace, TraceArgument.
    traceExportOptions
    The options that describe how the trace will be exported, TraceExportOptions.
    Exceptions
    ExceptionDescription
    outputJsonPath, traceArgument, and/or traceExportOptions are null.
    traceArgument is constructed using TraceArgument.TraceArgument Constructor(Subnetwork).

    This operation is not supported in client-server mode.

    -or-

    traceArgument contains unsupported result types.

    A geodatabase-related exception has occurred.
    Example
    Export circuits
    await QueuedTask.Run(() =>
    {
      using (TraceManager traceManager = utilityNetwork.GetTraceManager())
      using (CircuitManager circuitManager = utilityNetwork.GetCircuitManager(telecomDomainNetwork))
      using (UtilityNetworkDefinition utilityNetworkDefinition = utilityNetwork.GetDefinition())
      {
        IReadOnlyList<NetworkSource> networkSources = utilityNetworkDefinition.GetNetworkSources();
        IReadOnlyList<NetworkAttribute> networkAttributes = utilityNetworkDefinition.GetNetworkAttributes();
        IEnumerable<string> networkAttributeNames = networkAttributes.Select(s => s.Name);
    
        NetworkSource telcoDeviceNWSource = networkSources.First(f => f.Name.Contains("TelcoDevice"));
        NetworkSource telcoCircuit = networkSources.First(f => f.Name.Contains("TelcoCircuit"));
    
        TraceConfiguration traceConfiguration = new TraceConfiguration()
        {
          InferConnectivity = false,
          DomainNetwork = telecomDomainNetwork,
          IncludeContainers = true,
          IncludeContent = true,
          SynthesizeGeometries = false
        };
    
        ResultOptions resultOptions = new ResultOptions()
        {
          IncludeGeometry = true,
          NetworkAttributes = networkAttributeNames.ToList(),
          ResultFields = new Dictionary<NetworkSource, List<string>>() { { telcoDeviceNWSource, ["NEXTUNITID", "PARTITIONID"] },
            { telcoCircuit, ["LongTestField", "TextTestField", "DateTestField"] }}
        };
    
        CircuitExportOptions circuitExportOptions = new CircuitExportOptions()
        {
          IncludeDomainDescriptions = true,
          ResultOptions = resultOptions,
          ResultTypes = new List<ResultType> { ResultType.Circuit },
          ServiceSynchronizationType = ServiceSynchronizationType.Asynchronous,
          SetAcknowledged = false,
          TraceConfiguration = traceConfiguration
        };
    
        circuitManager.Export(circuitNames, circuitExportOptions, circuitExportPath);
      }
    });
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.7 or higher.
    See Also