EnableLRSUPDM

Title  Enable APR on UPDM

Description

Creates the script to enable LRS or enables LRS on a UPDM database with a utility network.

Usage

          
Creates the script to enable LRS or enables LRS on a UPDM database with a utility network.

License

Basic

Extensions

Location Referencing

Syntax

EnableLRSUPDM (in_utility_network, lrs_name, write_script, {output_folder})

Parameter Explanation Data Type
in_utility_network Dialog Reference

The utility network that will be used to create the LRS.

GPUtilityNetworkLayer
lrs_name Dialog Reference

The name of the LRS to create. The name for the LRS cannot already exist in the geodatabase.

GPString
write_script Dialog Reference

Option to only write a script to enable LRS and not perform the Geoprocessing calls. This script can be run through python to enable LRS. Selecting this option will enable the output folder parameter.

GPBoolean
output_folder (Optional) Dialog Reference

Output folder for the LRS script. The script name will start with "updm_lrs" and end with a unique GUID. This parameter is only valid when Write Output Script is true.

DEFolder

Code Samples

EnableLRSUPDM example 1 (Python window)

Enables UPDM on the target utility network.

import arcpy

arcpy.udms.EnableLRSUPDM("Naperville Network", "UN_LRS", "APPLY_CALLS")

EnableLRSUPDM example 2 (stand-alone script)

Creates script with python calls to enable UPDM.

import pathlib

import arcpy

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

script = arcpy.udms.EnableLRSUPDM(
    in_utility_network=un,
    lrs_name="UN_LRS",
    write_script=True,
    output_folder=folder,
)

print(script[0])