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
Column Description Example 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.
Syntax
arcpy.un.ExportRules(in_utility_network, rule_type, out_csv_file)
Parameter | Explanation | Data 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.
| String |
out_csv_file | The folder location and name of the .csv file to be created. | File |
Code sample
This sample exports all association rules from a utility network named GridNetwork.
import arcpy
arcpy.ExportRules_un("GridNetwork", "ALL", r"C:\Temp\AllAssociationRules.csv")
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")
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")
This sample exports containment association rules from a utility network named GridNetwork.
import arcpy
arcpy.ExportRules_un("GridNetwork", "CONTAINMENT",
r"C:\Temp\ContainmentAssociationRules.csv")
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
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes