Generate Web Isolation Trace Toolbox

Summary

Generates a new Python toolbox from the list of input parameters. It is designed to be published to ArcGIS Enterprise.

Usage

  • Specify your parameters, run the script, and refresh the Catalog window to find the newly created Python toolbox.

Syntax

arcpy.NOALIAS.GenerateIsolationTraceToolbox(geometric_network, source_feature_classes, snapping_feature_classes, snapping_tolerance, stopping_feature_classes, trace_result_feature_classes, output_folder, {system_barriers}, {convert_codes}, {buffer_type}, {buffer_distance})
ParameterExplanationData Type
geometric_network

The geometric network used for tracing.

  • If you're using an enterprise geodatabase, ensure that the database is registered with ArcGIS Enterprise.
  • If you're using a file geodatabase, the data will be copied to the ArcGIS Enterprise folder.

Geometric Network
source_feature_classes

The feature classes that are network sources. By default, all features in the source classes are evaluated. Specify a SQL expression to reduce the number of sources to be evaluated to improve performance. For example, in a water network, these would be the classes that represent the water towers and tanks, pumps, and treatment plants.

Value Table
snapping_feature_classes

The network feature classes to which the flags and barriers will be snapped before tracing.

Multiple Value
snapping_tolerance

The distance to snap the flags and barriers to the snapping feature classes.

Linear unit
stopping_feature_classes

The feature classes that are considered isolation features. For a water network, this is typically the system valves feature class.

Multiple Value
trace_result_feature_classes

The geometric network feature classes that will be returned from the trace. This list of feature classes is used to dynamically create the output parameters in the new Python toolbox.

Multiple Value
output_folder

The location where the generated toolbox and its required files will reside.

Workspace
system_barriers
(Optional)

A list of feature classes with system barriers. For a water network, this is typically the system valves feature class. A SQL expression is required to load a subset of features as barriers. For the system value layer in a water network, this SQL statement would select all closed valves.

Workspace
convert_codes
(Optional)

Converts all subtypes and coded value domains codes to descriptions in the results.

Boolean
buffer_type
(Optional)

Specifies the method that will generate the buffer area.

String
buffer_distance
(Optional)

The buffer distance for the resulting area. This parameter is required when using a BUFFER for Result Area Type.

Linear unit

Code sample

GenerateIsolationTraceToolbox (Python window)

The following Python window script demonstrates how to use the GenerateIsolationTraceToolbox too in immediate mode.

arcpy.gnsol.GenerateIsolationTraceToolbox(geometric_network="D:/Data/Water.gdb/Dataset/Network",
                                          source_feature_classes="Supply #",
                                          snapping_feature_classes="Mains", snapping_tolerance="50 Feet",
                                          stopping_feature_classes="SystemValve",
                                          trace_result_feature_classes="HydrantValve;ServiceConnection;SystemValve;Mains;Services",
                                          output_folder="D:/Output", system_barriers="SystemValve 'presentstatus = 0'",
                                          convert_codes="true", buffer_type="CONVEX_HULL", buffer_distance="5 Feet")
GenerateIsolationTraceToolbox (stand-alone script)

The following stand-alone script demonstrates how to use the GenerateIsolationTraceToolbox tool.

# Name: GenerateIsolationTraceToolbox.py
# Description: Generates a new Python toolbox from the list of input parameters which is designed to be published to
# ArcGIS Enterprise

# Import required modules
import arcpy

toolbox = r'D:/Data/GeometricNetworkTools.pyt'
arcpy.ImportToolbox(toolbox)
# Local Variables
geometric_network = "D:/Data/Water.gdb/Dataset/Network"
source_feature_classes = "Supply #"
snapping_feature_classes = "Mains"
snapping_tolerance = "50 Feet"
stopping_feature_classes = "SystemValve"
trace_result_feature_classes = "HydrantValve;ServiceConnection;SystemValve;Mains;Services"
output_folder = "D:/Output"
system_barriers = "SystemValve 'presentstatus = 0'"
convert_codes = "true"
buffer_type = "CONVEX_HULL"
buffer_distance = "5 Feet"

arcpy.gnsol.GenerateIsolationTraceToolbox(geometric_network=geometric_network,
                                          source_feature_classes=source_feature_classes,
                                          snapping_feature_classes=snapping_feature_classes,
                                          snapping_tolerance=snapping_tolerance,
                                          stopping_feature_classes=stopping_feature_classes,
                                          trace_result_feature_classes=trace_result_feature_classes,
                                          output_folder=output_folder,
                                          system_barriers=system_barriers,
                                          convert_codes=convert_codes,
                                          buffer_type=buffer_type,
                                          buffer_distance=buffer_distance)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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