Skip To Content

Add Trace Locations


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.

  • The Output has Z Values geoprocessing environment must be enabled.


AddTraceLocations(in_utility_network, out_feature_class, {load_selected_features}, {clear_trace_locations}, {trace_locations})
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. If you want 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

Loads selected features in the active map as trace locations.

  • LOAD_SELECTED_FEATURESLoads trace locations based on the selection in the map.
  • DO_NOT_LOAD_SELECTED_FEATURESDoes not load trace locations based on the selection in the map, but trace locations can be loaded using the trace_locations parameter. This is the default.

Specifies whether to clear or keep trace locations in the output feature class.

  • CLEAR_LOCATIONSClears existing trace locations.
  • KEEP_LOCATIONSKeeps existing trace locations. 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

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