Import Rules (Utility Network)

Summary

Import connectivity, structural attachment, and containment rules from a comma-separated values file into an existing utility network.

Usage

  • The information in the .csv file includes the following columns: RULETYPE, FROMFEATURECLASS, FROMASSETGROUP, FROMASSETTYPE, FROMTERMINAL, TOFEATURECLASS, TOASSETGROUP, TOASSETTYPE, TOTERMINAL, VIAFEATURECLASS, VIAASSETGROUP, VIAASSETTYPE, and VIATERMINAL.

    .csv columns

    ColumnDescriptionExample

    RULETYPE

    The type of rule.

    Junction Junction Connectivity, Junction Edge Connectivity, Edge Junction Edge Connectivity, Containment, Structural Attachment

    FROMFEATURECLASS, TOFEATURECLASS

    The feature class participating in the rule.

    ElectricDistributionDevice, ElectricDistributionAssembly, StructureDevice

    FROMASSETGROUP, TOASSETGROUP

    The asset group participating in the rule.

    Arrester, BreakerBank, JunctionBox, Switch

    FROMASSETTYPE, TOASSETTYPE

    The asset type participating in the rule.

    Tie Switch, Padmount, Overhead hood stick, Overhead gang operated

    FROMTERMINAL, TOTERMINAL

    The terminal participating in the rule. An asterisk (*) indicates that the rule applies to all terminals if the asset type has terminals.

    Single Terminal, Load, Source

    VIAFEATURECLASS, VIAASSETGROUP, VIAASSETTYPE, VIATERMINAL

    These columns are used only for edge-junction-edge connectivity rules. These are the connecting feature class, asset group, asset type, and terminal that are included in the rule.

    ElectricDistributionLine, Medium Voltage, Single Phase Overhead, Load

  • For containment rules, the FROM entry must be the container and the TO entry must be the content. Regarding structural attachment rules, the FROM entry must be the structure and the TO entry must be the structural attachment. Entry ordering does not pertain to junction-junction, junction-edge, and junction-edge-junction connectivity rules.

  • This tool can be used in conjunction with the Export Rules tool.

  • The network topology must be disabled.

  • When working with an enterprise geodatabase, the connected ArcGIS Enterprise portal account must be the portal utility network owner.

  • When working with an enterprise geodatabase, the Input Utility Network must be from a database connection established as the database utility network owner.

Syntax

arcpy.un.ImportRules(in_utility_network, rule_type, csv_file)
ParameterExplanationData Type
in_utility_network

Specifies the utility network to import the rules to.

Utility Network; Utility Network Layer
rule_type

Specifies the type of rules to import.

  • ALLOne or more types of rules
  • JUNCTION_JUNCTION_CONNECTIVITYJunction-junction connectivity association rules
  • JUNCTION_EDGE_CONNECTIVITYJunction-edge connectivity rules
  • CONTAINMENTContainment association rules
  • STRUCTURAL_ATTACHMENTStructural attachment association rules
  • EDGE_JUNCTION_EDGE_CONNECTIVITY Edge-junction-edge association rules
String
csv_file

Specifies the .csv file containing the rules to import.

File

Derived Output

NameExplanationData Type
out_utility_network

The updated utility nework.

Utility Network

Code sample

ImportRules example (Python window)

This sample script imports all types of rules into a utility network named GridNetwork.

import arcpy
arcpy.ImportRules_un("GridNetwork", "ALL", "C:\\Temp\\AllRules.csv")
ImportRules example 2 (Python window)

This sample script imports junction-junction connectivity association rules into a utility network named GridNetwork.

import arcpy
arcpy.ImportRules_un("GridNetwork", "JUNCTION_JUNCTION_CONNECTIVITY", 
                     "C:\\Temp\\JJconnectivityRules.csv")
ImportRules example 3 (Python window)

This sample script imports junction-edge connectivity rules into a utility network named GridNetwork.

import arcpy
arcpy.ImportRules_un("GridNetwork", "JUNCTION_EDGE_CONNECTIVITY", 
                     "C:\\Temp\\JEconnectivityRules.csv")
ImportRules example 4 (Python window)

This sample script imports containment association rules into a utility network named GridNetwork.

import arcpy
arcpy.ImportRules_un("GridNetwork", "CONTAINMENT", 
                     "C:\\Temp\\ContainmentRules.csv")
ImportRules example 5 (Python window)

This sample script imports structural attachment association rules into a utility network named GridNetwork.

import arcpy
arcpy.ImportRules_un("GridNetwork", "STRUCTURAL_ATTACHMENT", 
                     "C:\\Temp\\StructuralAttachmentRules.csv")

Environments

Licensing information

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

Related topics