Summary
Exports associations from a utility network to a comma-separated-values file (.csv). This tool can be used in conjunction with the Import Associations tool.
Usage
When working with an enterprise geodatabase, the Input Utility Network must be from a database connection established as the database utility network owner.
The information in the .csv file is stored in the following format: ASSOCIATIONTYPE, FROMFEATURECLASS, FROMASSETGROUP, FROMASSETTYPE, FROMGLOBALID, FROMTERMINAL, TOFEATURECLASS, TOASSETGROUP, TOASSETTYPE, TOGLOBALID, TOTERMINAL, ISCONTENTVISIBLE, PERCENTALONG.
.csv columns
Column Description Example ASSOCIATIONTYPE
The type of association.
- Junction Junction Connectivity
- Junction Edge From Connectivity
- Junction Edge Midspan Connectivity
- Junction Edge To Connectivity
- Containment
- Structural Attachment
Containment
FROMFEATURECLASS/TOFEATURECLASS
The feature class or object participating in the association.
ElectricDistributionDevice, ElectricDistributionAssembly, StructureJunction
FROMASSETGROUP/TOASSETGROUP
The asset group of the feature.
Transformer, Fuse, Elbow
FROMASSETTYPE/TOASSETTYPE
The asset type of the feature.
Streetlight, Attachment, Single-phase padmounted
FROMGLOBALID/TOGLOBALID
The global ID of the feature.
{16558C73-013C-4169-A095-7E9DCD57EB57}
FROMTERMINAL/TOTERMINAL
The terminal participating in the association. This is only applicable to junction-junction connectivity associations.
Single Terminal, Load, Source
ISCONTENTVISIBLE
A Boolean flag indicating whether the content is visible. This is only applicable to containment associations.
False, True
PERCENTALONG
The percent along value for junction-edge midspan connectivity associations between a junction object and an edge object.
0.75
Syntax
ExportAssociations(in_utility_network, association_type, out_csv_file)
Parameter | Explanation | Data Type |
in_utility_network | The utility network containing the associations to export. | Utility Network; Utility Network Layer |
association_type | Specifies the type of association to export.
| String |
out_csv_file | The name and location of the .csv file that will be generated. | File |
Code sample
This sample script exports all associations for a utility network called GridNetwork.
import arcpy
arcpy.ExportUtilityNetworkAssociations_un("GridNetwork", "ALL",
r"C:\Temp\AllAssociations.csv")
This sample script exports junction-junction connectivity associations for a utility network called GridNetwork.
import arcpy
arcpy.ExportUtilityNetworkAssociations_un("GridNetwork", "JUNCTION_JUNCTION_CONNECTIVITY",
r"C:\Temp\JJAssociations.csv")
This sample script exports containment associations for a utility network called GridNetwork.
import arcpy
arcpy.ExportUtilityNetworkAssociations_un("GridNetwork", "CONTAINMENT",
r"C:\Temp\ContainmentAssociations.csv")
This sample script exports structural attachment associations for a utility network called GridNetwork.
import arcpy
arcpy.ExportUtilityNetworkAssociations_un("GridNetwork", "STRUCTURAL_ATTACHMENT",
r"C:\Temp\StructureAssociations.csv")
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes