CreateUNTerminalContingentValues

Title  Create Terminal Contingent Values

Description

Creates contingent values for Utility Network terminal fields.

Usage

          
This tool creates contingent values on these sources and fields:
SourceFieldLogic
LineFromDeviceTerminalNetwork Rules
LineToDeviceTerminalNetwork Rules
DeviceTerminalConfigurationAssigned Terminal
JunctionObjectTerminalConfigurationAssigned Terminal
The necessary coded value domains will be created and assigned for the contingent values to work.

License

Basic

Toolset

Utility Network

Syntax

CreateUNTerminalContingentValues (network, folder, {apply_changes}, {remove_schema}, {terminal_fields})

Parameter Explanation Data Type
network Dialog Reference

The utility network

GPUtilityNetworkLayer
folder Dialog Reference

The output folder where the csv files and python script will be saved. A uniquely named folder ContingentValues will be created here.

DEFolder
apply_changes (Optional) Dialog Reference

Specifies if schema modifications are applied.

  • Unchecked - Save the python script only.
  • Checked - Save and run the python script. This is the default.

GPBoolean
remove_schema (Optional) Dialog Reference

Specifies if the schema is added or removed.

  • Unchecked - Add the schema for the contingent values. This is the default
  • Checked - Remove the schema for the contingent values.

GPBoolean
terminal_fields (Optional) Dialog Reference

Additional SHORT fields on the domain device and junction object classes to assign contingent values. The fields must not have any network attribute assignments or have an existing domain assigned at the field level.

GPString

Code Samples

CreateUNTerminalContingentValues example 1 (Python window)

Create Contingent Value CSVs for the valid terminal combinations.

import arcpy

arcpy.udms.CreateUNTerminalContingentValues("Naperville Network", "D:/data/cav")

CreateUNTerminalContingentValues example 2 (stand-alone script)

Create Contingent Value CSVs for the valid terminal combinations.

import pathlib

import arcpy

un = "D:/data/network.gdb/UtilityNetwork/Network"
folder = pathlib.Path(un).parents[2] / "CAV"
folder.mkdir(parents=True, exist_ok=True)

result = arcpy.udms.CreateUNTerminalContingentValues(
    network=un,
    folder=str(folder),
    apply_changes=True,
    remove_schema=False,
)