Import Trace Configurations (Utility Network)

Summary

Imports named trace configurations from JSON format (.json file) to a utility network.

This tool can be used in conjunction with the Export Trace Configurations tool.

Learn more about importing trace configurations

Usage

  • The input utility network must be version 5 or later.

  • The following requirements must be met when working with an enterprise geodatabase:
    • The Input Utility Network parameter value must be from a utility network service.
    Note:
  • The named trace configurations must be in a single .json file.

  • The information in the .json file is stored in the following format:

    [
    	{
    		"creator": "<property representing the connected portal account on creation>",
    		"name": "<property  representing the name for the named trace configuration>",
    		"description": "<property representing the description of the named trace configuration>",
    		"traceType": <property representing the trace type>,
    		"configuration": <property representing the collection of trace configuration parameters>,
    		"resultTypes": "[<property representing the types of results to return>]",
    		"tags": "<property representing user provided tags>"
    	}
    ]

    Example:

    [
    	{
    		"creator": "portaladmin_un",
    		"name": "Connected_RMT002_A",
    		"description": "Connected trace on subnet RMT002",
    		"traceType": 1,
    		"configuration": "{"includeBarriers":true,"validateConsistency":true,"ignoreBarriersAtStartingPoints":false,"allowIndeterminateFlow":false,"shortestPathNetworkAttributeName":"","traversabilityScope":"junctionsAndEdges","conditionBarriers":[],"functionBarriers":[],"functions":[],"outputFilters":[],"outputConditions":[],"pathDirection":"noDirection"}",
    		"resultTypes": "[{"type":"elements","includeGeometry":false,"includePropagatedValues":false,"networkAttributeNames":[],"diagramTemplateName":"","resultTypeFields":[]},{"type":"aggregatedGeometry","includeGeometry":false,"includePropagatedValues":false,"networkAttributeNames":[],"diagramTemplateName":"","resultTypeFields":[]}]",
    		"tags": "["connected","RMT002"]"
    	}
    ]

Parameters

LabelExplanationData Type
Input Utility Network

The utility network to which the named trace configurations will be imported.

Utility Network; Utility Network Layer
Input File (.json)

The .json file containing the named trace configurations to import.

File

Derived Output

LabelExplanationData Type
Updated Utility Network

The updated utility network.

Utility Network

arcpy.un.ImportTraceConfigurations(in_utility_network, in_json_file)
NameExplanationData Type
in_utility_network

The utility network to which the named trace configurations will be imported.

Utility Network; Utility Network Layer
in_json_file

The .json file containing the named trace configurations to import.

File

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network.

Utility Network

Code sample

ImportTraceConfigurations example (Python window)

This sample script imports named trace configurations into a utility network called ElecNetwork.

import arcpy
arcpy.ImportTraceConfigurations_un("ElecNetwork", 
                                   r"c:\temp\trace_configurations.json")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics