Add Rule (Utility Network)

Summary

Adds a network rule to a utility network.

All network rules created in a utility network are based on classes in the domain network and structure network at the asset group and asset type levels that allow you to define which types of features or objects can connect or associate. These rules are defined based on business practices and are used in conjunction with feature restrictions, which restrict the valid relationships between classes, to manage the correctness of assets in a network.

Learn more about feature restrictions and network rules

Usage

  • The network topology must be disabled.

  • To enable the network topology for a utility network, there must be rules present.

  • You can only add rules to a utility network that respect feature restrictions.

  • The following requirements must be met when working with an enterprise geodatabase:

Parameters

LabelExplanationData Type
Input Utility Network

The utility network for which the rule will be added.

Utility Network; Utility Network Layer
Rule Type

Specifies the type of rule that will be created.

  • Junction-junction connectivityA junction-junction connectivity rule will be created to allow point features or junction objects to connect through a connectivity association.
  • ContainmentA containment rule will be created in which the from parameters are the container and the to parameters are the contents in a containment association.
  • Structural attachmentA structural attachment rule will be created in which the from parameters are the structure features or objects and the to parameters are the attachment features or objects in a structural attachment association.
  • Junction-edge connectivityA junction-edge connectivity rule will be created to allow point and line features to connect through geometric coincidence (features are at the same x,y,z location), or allow an edge object to connect with point features or junction objects through a connectivity association.
  • Edge-junction-edge connectivityAn edge-junction-edge connectivity rule will be created to allow a line to connect to either side of a point feature, or allow an edge object to connect with another line or edge object through a point feature or junction object.
String
From Table

The from utility network feature class or nonspatial object that will be included in the rule.

Structural attachment and containment association rules require that the container or structure network feature be in this parameter.

When creating junction-edge and edge-junction-edge connectivity rules, this parameter must reference the junction or junction object.

String
From Asset Group

An asset group for the From Table parameter value to which the rule will apply.

String
From Asset Type

An asset type for the From Table parameter value to which the rule will apply.

String
To Table

The to utility network feature class or nonspatial object that will be included in the rule.

Structural attachment and containment associations rules require that the content or attachment network feature be in this parameter.

When creating junction-edge and edge-junction-edge connectivity rules, the From Table parameter must reference the junction or junction object.

String
To Asset Group

An asset group for the To Table parameter value to which the rule will apply.

String
To Asset Type

An asset type for the To Table parameter value to which the rule will apply.

String
From Terminal
(Optional)

The from terminal to which the rule will apply. This will be a terminal in the From Table parameter value. When creating a connectivity rule for a device or junction object with terminals to connect to another network feature, the terminal side to connect from must be specified, for example, the high-side terminal on a transformer.

This parameter is required if the asset type has terminals. It is inactive when the structural attachment or containment association rule is specified in the Rule Type parameter.

String
To Terminal
(Optional)

The to terminal to which the rule will apply. This will be a terminal in the To Table parameter value. When creating a connectivity rule for a for a device or junction object to connect to another network feature with terminals, the terminal side to connect to must be specified, for example, the low-side terminal on a transformer.

This parameter is required if the asset type has terminals. It is inactive for structural attachment or containment association rule types.

String
Via Table
(Optional)

The junction utility network feature class or object to which the rule will apply. This parameter is available only when the Rule Type parameter is set to Edge-junction-edge connectivity, since three classes are required to participate in edge-junction-edge connectivity.

String
Via Asset Group
(Optional)

An asset group of the Via Table parameter value to which the rule will apply. This parameter is available only when the Rule Type parameter is set to Edge-junction-edge connectivity.

String
Via Asset Type
(Optional)

An asset type of the Via Table parameter value to which the rule will apply. This parameter is available only when the Rule Type parameter is set to Edge-junction-edge connectivity.

String
Via Terminal
(Optional)

The terminal from the Via Table parameter value to which the rule will apply. This parameter is available only when the Rule Type parameter is set to Edge-junction-edge connectivity.

String

Derived Output

LabelExplanationData Type
Updated Utility Network

The updated utility network.

Utility Network

arcpy.un.AddRule(in_utility_network, rule_type, from_class, from_assetgroup, from_assettype, to_class, to_assetgroup, to_assettype, {from_terminal}, {to_terminal}, {via_class}, {via_assetgroup}, {via_assettype}, {via_terminal})
NameExplanationData Type
in_utility_network

The utility network for which the rule will be added.

Utility Network; Utility Network Layer
rule_type

Specifies the type of rule that will be created.

  • JUNCTION_JUNCTION_CONNECTIVITYA junction-junction connectivity rule will be created to allow point features or junction objects to connect through a connectivity association.
  • CONTAINMENTA containment rule will be created in which the from parameters are the container and the to parameters are the contents in a containment association.
  • STRUCTURAL_ATTACHMENTA structural attachment rule will be created in which the from parameters are the structure features or objects and the to parameters are the attachment features or objects in a structural attachment association.
  • JUNCTION_EDGE_CONNECTIVITYA junction-edge connectivity rule will be created to allow point and line features to connect through geometric coincidence (features are at the same x,y,z location), or allow an edge object to connect with point features or junction objects through a connectivity association.
  • EDGE_JUNCTION_EDGE_CONNECTIVITYAn edge-junction-edge connectivity rule will be created to allow a line to connect to either side of a point feature, or allow an edge object to connect with another line or edge object through a point feature or junction object.
String
from_class

The from utility network feature class or nonspatial object that will be included in the rule.

Structural attachment and containment association rules require that the container or structure network feature be in this parameter.

When creating junction-edge and edge-junction-edge connectivity rules, this parameter must reference the junction or junction object.

String
from_assetgroup

An asset group for the from_class parameter value to which the rule will apply.

String
from_assettype

An asset type for the from_class parameter value to which the rule will apply.

String
to_class

The to utility network feature class or nonspatial object that will be included in the rule.

Structural attachment and containment associations rules require that the content or attachment network feature be in this parameter.

When creating junction-edge and edge-junction-edge connectivity rules, the from_class parameter must reference the junction or junction object..

String
to_assetgroup

An asset group for the to_class parameter value to which the rule will apply.

String
to_assettype

An asset type for the to_class parameter value to which the rule will apply.

String
from_terminal
(Optional)

The from terminal to which the rule will apply. This will be a terminal in the from_class parameter value. When creating a connectivity rule for a device or junction object with terminals to connect to another network feature, the terminal side to connect from must be specified, for example, the high-side terminal on a transformer.

This parameter is required if the asset type has terminals. It is ignored for structural attachment or containment rule types.

String
to_terminal
(Optional)

The to terminal to which the rule will apply. This will be a terminal in the to_class parameter value. When creating a connectivity rule for a device or junction object to connect to another network feature with terminals, the terminal side to connect to must be specified, for example, the low-side terminal on a transformer.

This parameter is required if the asset type has terminals. It is ignored for structural attachment or containment rule types.

String
via_class
(Optional)

The junction utility network feature class or table to which the rule will apply. This parameter can only be specified when the rule_type parameter is set to EDGE_JUNCTION_EDGE_CONNECTIVITY, since three classes are required to participate in edge-junction-edge connectivity.

String
via_assetgroup
(Optional)

An asset group of the via_class parameter value to which the rule will apply. This parameter can only be specified when the rule_type parameter is set to EDGE_JUNCTION_EDGE_CONNECTIVITY.

String
via_assettype
(Optional)

An asset type of the via_class parameter value to which the rule will apply. This parameter can only be specified when the rule_type parameter is set to EDGE_JUNCTION_EDGE_CONNECTIVITY.

String
via_terminal
(Optional)

The terminal from the via_class parameter value to which the rule will apply. This parameter can only be specified when the rule_type parameter is set to EDGE_JUNCTION_EDGE_CONNECTIVITY.

String

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network.

Utility Network

Code sample

AddRule example 1 (Python window)

This sample creates a junction-junction connectivity association rule to allow the load side of circuit breakers to connect to the high side of transformers in an electric distribution network.

import arcpy
arcpy.un.AddRule("Distribution Network", "JUNCTION_JUNCTION_CONNECTIVITY", 
                 "ElectricDistributionDevice", "CircuitBreaker", "Air powered", 
                 "ElectricDistributionLine", "Transformer", "High")
AddRule example 2 (Python window)

This sample creates a junction-edge connectivity rule to allow the load side of circuit breakers to connect to medium-voltage lines in an electric distribution network.

import arcpy
arcpy.un.AddRule("Utility Network", "JUNCTION_EDGE_CONNECTIVITY", 
                 "ElectricDistributionDevice", "CircuitBreaker", "Air powered", 
                 "ElectricDistributionLine", "Medium Voltage", 
                 "Single Phase Overhead")
AddRule example 3 (Python window)

This sample script creates a containment association rule to allow a junction box to contain an elbow.

import arcpy
arcpy.un.AddRule("Electric Network", "CONTAINMENT", "StructureJunction", 
                 "JunctionBox", "Junction Box", "ElectricDistributionDevice", 
                 "Fuse", "Underground Single Phase Load Break Elbow")
AddRule example 4 (Python window)

This sample script creates a structural attachment association rule to allow a switch to be structurally attached to a pole.

import arcpy
arcpy.un.AddRule("Electric Network", "STRUCTURAL_ATTACHMENT", 
                 "StructureJunction", "Pole", "Wood", 
                 "ElectricDistributionDevice", "Switch", 
                 "Overhead Low Voltage Single Phase Disconnect")

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics