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)
Parameter | Explanation | Data 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.
| Boolean |
clear_trace_locations (Optional) | Specifies whether trace locations will be cleared from the output feature class.
| 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:
| Value Table |
filter_barrier | Specifies the behavior of the barriers for the trace locations.
Note:This parameter requires ArcGIS Enterprise 10.8.1 or later. | Boolean |
Code sample
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")
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)' '' )
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes