AddUNSystemTables

Title  Create Utility Network System Tables Views

Description

Generate views on the utility network system tables.

Usage

          
This tool generates database views for the utility network system tables for Geodatabases and table views for services.
Ensure 'Add output datasets to an open map' is checked if you want the results added to your map.

License

Standard

Syntax

AddUNSystemTables (network, tables, {register_view})

Parameter Explanation Data Type
network Dialog Reference

The utility network

GPUtilityNetworkLayer
tables Dialog Reference

The Utility Network system tables to generate views on.

GPString
register_view (Optional) Dialog Reference

Register the views with the Geodatabase.

GPBoolean

Code Samples

AddUNSystemTables example 1 (Python window)

Add a collection of Utility Network System tables to the active map.

import arcpy

arcpy.udms.AddUNSystemTables("Naperville Network", ["ASSOCIATIONS", "SYSTEM_JUNCTIONS"])

AddUNSystemTables example 2 (stand-alone script)

Use the path and properties of the UN to determine what system tables to view.

import arcpy

un = "D:/data/network.gdb/UtilityNetwork/Network"

# The UN schema generation and client-server vs services determines what tables are exposed.
describe = arcpy.Describe(un)
is_services = describe.path.lower().startswith("http")
version = describe.schemaGeneration

tables = [
    "ASSOCIATIONS",
    "RULES",
    "SUBNETWORKS",
]

if not is_services:
    tables.extend(
        [
            "DIRTY_AREAS",
            "SYSTEM_JUNCTIONS",
            "DIAGRAMS",
            "TMP_DIAGRAMS",
        ]
    )
    if version >= 5:
        tables.append("TRACE_CONFIGURATIONS")

views = arcpy.udms.AddUNSystemTables(
    network=un,
    tables=tables,
)

for view in views[0].split(";"):
    print(view.strip("'"))