Summary
Adds a rule to a utility network.
All rules created within a utility network are based on network classes at the asset group and asset type levels and can be used to control some behaviors in the utility network.
Usage
The network topology must be disabled.
- The following requirements must be met when working with an
enterprise geodatabase:
- The Input Utility Network parameter must be from a database connection established as the database utility network owner.
- The connected ArcGIS Enterprise portal account must be the portal utility network owner.
Syntax
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})
Parameter | Explanation | Data Type |
in_utility_network | The utility network for which the rule will be added. | Utility Network; Utility Network Layer |
rule_type | The type of rule to be created.
| String |
from_class | The from utility network feature class or table that will be included in the rule. Structural attachment and containment association rules require that the container or structure feature be in this parameter. Ordering is irrelevant for the junction-junction, junction-edge, and edge-junction-edge connectivity rules. | String |
from_assetgroup | An asset group for the from_class to which the rule will apply. | String |
from_assettype | An asset type for the from_class to which the rule will apply. | String |
to_class | The to utility network feature class or table that will be included in the rule. Structural attachment and containment associations rules require that the content or attachment feature be in this parameter. Ordering is irrelevant for the junction-junction, junction-edge, and edge-junction-edge connectivity rules. | String |
to_assetgroup | An asset group for the to_class to which the rule will apply. | String |
to_assettype | Specifies an asset type for the to_class 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. When creating a connectivity rule for feature with terminals to connect to another 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. When creating a connectivity rule for feature to connect to another 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 be specified only for the EDGE_JUNCTION_EDGE_CONNECTIVITY rule_type, since three feature classes or tables are required to participate in edge-junction-edge connectivity. | String |
via_assetgroup (Optional) | An asset group of the via_class to which the rule will apply. This parameter can only be specified for the EDGE_JUNCTION_EDGE_CONNECTIVITY rule_type parameter value. | String |
via_assettype (Optional) | An asset type of the via_class to which the rule will apply. This parameter can only be specified for the EDGE_JUNCTION_EDGE_CONNECTIVITY rule_type parameter value. | String |
via_terminal (Optional) | The terminal from the via_class to which the rule will apply. This parameter can only be specified for the EDGE_JUNCTION_EDGE_CONNECTIVITY rule_type parameter value. | String |
Derived Output
Name | Explanation | Data Type |
out_utility_network | The updated utility network. | Utility Network |
Code sample
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.AddRule_un("Distribution Network", "JUNCTION_JUNCTION_CONNECTIVITY",
"ElectricDistributionDevice", "CircuitBreaker", "Air powered",
"ElectricDistributionLine", "Transformer", "High")
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.AddRule_un("Utility Network", "JUNCTION_EDGE_CONNECTIVITY",
"ElectricDistributionDevice", "CircuitBreaker", "Air powered",
"ElectricDistributionLine", "Medium Voltage",
"Single Phase Overhead")
This sample script creates a containment association rule to allow a junction box to contain an elbow.
import arcpy
arcpy.AddRule_un("Electric Network", "CONTAINMENT", "StructureJunction",
"JunctionBox", "Junction Box", "ElectricDistributionDevice",
"Fuse", "Underground Single Phase Load Break Elbow")
This sample script creates a structural attachment association rule to allow a switch to be structurally attached to a pole.
import arcpy
arcpy.AddRule_un("Electric Network", "STRUCTURAL_ATTACHMENT",
"StructureJunction", "Pole", "Wood",
"ElectricDistributionDevice", "Switch",
"Overhead Low Voltage Single Phase Disconnect")
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes