Title  Batch Trace


Iterate through the starting points to trace the utility network and use the results.


This tool uses a with starting point information to trace the utility network. The starting points are optionally grouped so set of starting points is used in each trace.
The trace results can be used to select features in a map, calculate values on results, create connectivity and element files or save the aggregated geometry with summary information.
The starting points layer uses a field to determine if a row is a starting point and/or barrier. A feature as a starting point and filter barrier is useful in a connected trace to determine all the items between the starting points.

The starting points table requires the following fields:




BatchTrace (in_utility_network, trace_locations, result_types, trace_config, {expression}, {output_folder}, {key_field}, {summary_store_field}, {fields}, {calc_on_start}, {history_field})

Parameter Explanation Data Type
in_utility_network Dialog Reference

The utility network that will be used to trace.

trace_locations Dialog Reference

The table from which to load starting points for trace.

result_types Dialog Reference

Specifies the type of results that will be returned by the trace.

  • Selection - The trace results will be returned as a selection set on the appropriate network features.
  • Aggregated Geometry - The trace results will be aggregated by geometry type and stored in multipart feature classes displayed in the layers in the active map.
  • Connectivity - The trace results will be returned as a connectivity graph in a specified output .json file. This option requires the Output JSON parameter.
  • Elements - The trace results will be returned as feature-based information in a specified output .json file. This option requires the Output JSON parameter.
  • Calculate - Update a field in the trace results from information on the starting points. If multiple starting points are used, the value from the lowest OID is used.

trace_config Dialog Reference

The utility network trace configuration used to define the trace parameters or a field with trace configurations.

expression (Optional) Dialog Reference

The simple calculation expression used to limit the starting points used in a trace.

output_folder (Optional) Dialog Reference

The location of the output items. If specified, a stats mobile geodatabase is created here. The folder is required for the Connectivity, Elements and Aggregated Results result types. For Connectivity and Elements result types, the json_files folder will contain the resulting files. For the Aggregated Results result type, a mobile geodatabase called AggregatedGeometry is created in this location.

key_field (Optional) Dialog Reference

Field used to group starting points and barriers. When specified, records with the same value will used for a single trace. By default, a trace is run for every starting point.

summary_store_field (Optional) Dialog Reference

Optional field used to store summary results on the starting points.

fields (Optional) Dialog Reference

The mapping of starting points field to network source field. This parameter is only applicable for the Calculation result type. Mapping components are as follows:

  • From Field - The field from the starting points to propagate.
  • Source Name - The name of the utility network source.
  • To Field - The field on the source class to update.
  • Calculation Mode - How to combine values.
Calculation mode supports:
  • Concatenate with existing - Read existing values and combine with new values.
  • Concatenate and overwrite - Combine new values.

calc_on_start (Optional) Dialog Reference

If specified, the calculate will also update the features the starting points are placed on.

history_field (Optional) Dialog Reference

A field with a historical date value(as a string) that will be used to run a trace in a previous moment to compare to the current moment.


Code Samples