Add Trace Locations (Utility Network)

Summary

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

Usage

  • 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.

Syntax

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

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

Utility Network; Utility Network Layer
out_feature_class

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
load_selected_features
(Optional)

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.
Boolean
clear_trace_locations
(Optional)

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.
Boolean
trace_locations
[[Layer Name, Global ID, Terminal ID, Percent Along],...]
(Optional)

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
filter_barrier

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.
Note:

This parameter requires ArcGIS Enterprise 10.8.1 or later.

Boolean

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", 
                           r"C:\MyUNProject\MyUNProject.gdb\TraceLocations",
                           "LOAD_SELECTED_FEATURES")
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
arcpy.AddTraceLocations_un(r"http://utilitynetwork.esri.com/server/rest/services/NapervilleElectric/FeatureServer/9", 
                           r"C:\MyUNProject\MyUNProject.gdb\TraceLocations",
                           "DO_NOT_LOAD_SELECTED_FEATURES",
                           "KEEP_LOCATIONS",
                           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