Export Rules (Utility Network)

Summary

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

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

  • The output of this tool can be used as input to the Import Rules tool.

  • 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.

Parameters

LabelExplanationData Type
Input Utility Network

The utility network to export the rules from.

Utility Network; Utility Network Layer
Rule Type

The type of rule to export.

  • AllAll the rules in the utility network will be exported.
  • Junction-junction connectivityJunction-junction connectivity association rules will be exported.
  • Junction-edge connectivityJunction-edge connectivity rules will be exported.
  • ContainmentContainment association rules will be exported.
  • Structural attachmentStructural attachment association rules will be exported.
  • Edge-junction-edge connectivityEdge-junction-edge connectivity association rules will be exported.
String
Output File

The folder location and name of the .csv file to be created.

File

arcpy.un.ExportRules(in_utility_network, rule_type, out_csv_file)
NameExplanationData Type
in_utility_network

The utility network to export the rules from.

Utility Network; Utility Network Layer
rule_type

The type of rule to export.

  • ALLAll the rules in the utility network will be exported.
  • JUNCTION_JUNCTION_CONNECTIVITYJunction-junction connectivity association rules will be exported.
  • JUNCTION_EDGE_CONNECTIVITYJunction-edge connectivity rules will be exported.
  • CONTAINMENTContainment association rules will be exported.
  • STRUCTURAL_ATTACHMENTStructural attachment association rules will be exported.
  • EDGE_JUNCTION_EDGE_CONNECTIVITYEdge-junction-edge connectivity association rules will be exported.
String
out_csv_file

The folder location and name of the .csv file to be created.

File

Code sample

ExportRules example (Python window)

This sample exports all association rules from a utility network named GridNetwork.

import arcpy
arcpy.ExportRules_un("GridNetwork", "ALL", r"C:\Temp\AllAssociationRules.csv")
ExportRules example 2 (Python window)

This sample exports junction-junction connectivity association rules from a utility network named GridNetwork.

import arcpy
arcpy.ExportRules_un("GridNetwork", "JUNCTION_JUNCTION_CONNECTIVITY", 
                     r"C:\Temp\JJAssociationRules.csv")
ExportRules example 3 (Python window)

This sample exports junction-edge connectivity rules from a utility network named GridNetwork.

import arcpy
arcpy.ExportRules_un("GridNetwork", "JUNCTION_EDGE_CONNECTIVITY", 
                     r"C:\Temp\JEAssociationRules.csv")
ExportRules example 4 (Python window)

This sample exports containment association rules from a utility network named GridNetwork.

import arcpy
arcpy.ExportRules_un("GridNetwork", "CONTAINMENT", 
                     r"C:\Temp\ContainmentAssociationRules.csv")
ExportRules example 5 (Python window)

This sample exports structural attachment association rules from a utility network named GridNetwork.

import arcpy
arcpy.ExportRules_un("GridNetwork", "STRUCTURAL_ATTACHMENT", 
                     r"C:\Temp\StructureAssociationRules.csv")

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics