Add Trace Locations (Utility Network)


Creates a feature class to be used as the starting points and barriers input for the Trace tool.


  • The output feature class has the same schema as the input starting points and barriers required as input for the Trace tool. This allows you to specify different trace locations across trace operations in ModelBuilder or a scripting environment.

  • You cannot simultaneously specify values for the Load Selected Features and Trace Locations parameters; they are mutually exclusive.


AddTraceLocations(in_utility_network, out_feature_class, {load_selected_features}, {clear_trace_locations}, {trace_locations}, filter_barrier)
ParameterExplanationData Type

The input utility network where the trace locations will be added.

Utility Network; Utility Network Layer

The output feature class containing the trace locations. If you specify a new feature class name, a new output feature class will be created.

To use an existing feature class that was previously created by this tool and append or overwrite the existing locations, specify the name of the existing feature class.

Feature Class

Specifies whether selected features in the active map will be loaded as trace locations.

  • LOAD_SELECTED_FEATURESTrace locations will be loaded based on the selection in the map.
  • DO_NOT_LOAD_SELECTED_FEATURESTrace locations will not be loaded based on the selection in the map. This is the default. However, trace locations can be loaded using the trace_locations parameter.

Specifies whether trace locations will be cleared from the output feature class.

  • CLEAR_LOCATIONSExisting trace locations will be cleared.
  • KEEP_LOCATIONSExisting trace locations will not be cleared; they will be kept. This is the default.
[[Layer Name, Global ID, Terminal ID, Percent Along],...]

The trace locations that will be added to the output feature class. If you are not using the load_selected_features parameter in an active map, you can use this parameter to specify the utility network features to add as trace locations by providing the required values in the value table.

The trace locations properties are as follows:

  • Layer Name—The layer or feature class participating in the utility network that contains a starting point or barrier location to be added. If there is an active map, only layers from the map are allowed; if not, this will be the feature class name.
  • Global ID—The Global ID of the feature for the location to add.
  • Terminal ID—The terminal ID of the feature for the location to add.
  • Percent Along—The percent along value of the feature. For line features, the default value is 0.5.

Value Table

Specifies the behavior of the barriers for the trace locations.

Learn more about barriers

  • FILTER_BARRIERThe barrier behaves like a filter barrier. This is useful for subnetwork-based traces where the barrier allows the subnetwork to be evaluated first and then is applied on a second traversal of the network features, essentially acting like a filter barrier.
  • TRAVERSABILITY_BARRIERThe barrier behaves like a traversability barrier. Traversability barriers define the extent of subnetworks and will be evaluated on the first pass. This is the default.

This parameter requires ArcGIS Enterprise 10.8.1 or later.


Code sample

AddTraceLocations example 1 (Python window)

Add trace locations to a new output feature class named TraceLocations by loading features selected in the active map.

import arcpy
arcpy.env.outputZFlag = "Enabled"
arcpy.AddTraceLocations_un("Naperville Electric UN", 
AddTraceLocations example 2 (stand-alone script)

Add trace locations to an existing feature class named TraceLocations with no active map.

import arcpy

# Set the outputZFlag environment to Enabled
arcpy.env.outputZFlag = "Enabled"

# AddTraceLocations
                           r"'Circuit Breaker' {DDB0765D-860A-4054-908D-9360E1A32F74} '(3/Load)' '';'Circuit Breaker' {4849D307-6413-40B7-B672-716AF50EE6E6} '(3/Load)' '' )

Licensing information

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

Related topics