Skip To Content

Export Associations

Summary

Exports connectivity, containment, and structural attachment associations from a utility network into a comma separated values (.csv) file.

All types of associations can be exported including junction-junction connectivity, structural attachment, and containment.

Usage

  • The information in the .csv file is stored in the following format: ASSOCIATIONTYPE, FROMFEATURECLASS, FROMASSETGROUP, FROMASSETTYPE, FROMGLOBALID, FROMTERMINAL, TOFEATURECLASS, TOASSETGROUP, TOASSETTYPE, TOGLOBALID, TOTERMINAL, ISCONTENTVISIBLE.

    .csv columns

    ColumnDescriptionExample

    ASSOCIATIONTYPE

    The type of association.

    JUNCTION_JUNCTION_CONNECTIVITY, CONTAINMENT, STRUCTURAL_ATTACHMENT

    FROMFEATURECLASS/TOFEATURECLASS

    The feature class participating in the association.

    ElectricDistributionDevice, ElectricDistributionAssembly, StructureDevice

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

    Single Terminal, Load, Source

    ISCONTENTVISIBLE

    A Boolean flag indicating whether the content is visible. This is only applicable to structural attachment and containment associations.

    False, True

  • Associations of the specified type must be present in order to export them.

  • This tool can be used in conjunction with the Import Associations tool.

  • The connected ArcGIS Enterprise portal account must be the portal utility network owner.

  • The input utility network must be from a database connection established as the database utility network owner.

Syntax

ExportAssociations(in_utility_network, association_type, out_csv_file)
ParameterExplanationData Type
in_utility_network

The utility network containing the associations to export.

Utility Network; Utility Network Layer
association_type

The type of association to export.

  • ALLAll associations in the utility network are exported to a .csv file.
  • JUNCTION_JUNCTION_CONNECTIVITYConnectivity associations allowing two junction subtypes to connect via a connectivity association (features are offset geometrically) are exported to a .csv file.
  • CONTAINMENTContainment associations are exported to a .csv file.
  • STRUCTURAL_ATTACHMENTStructural attachment associations are exported to a .csv file.
String
out_csv_file

The name and location of the .csv file that will be generated.

File

Code sample

ExportAssociations example 1 (Python window)

This sample script exports all associations for a utility network called GridNetwork.

import arcpy
arcpy.ExportUtilityNetworkAssociations_un("GridNetwork", "ALL", 
                                          r"C:\Temp\AllAssociations.csv")
ExportAssociations example 2 (Python window)

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")
ExportAssociations example 3 (Python window)

This sample script exports containment associations for a utility network called GridNetwork.

import arcpy
arcpy.ExportUtilityNetworkAssociations_un("GridNetwork", "CONTAINMENT", 
                                          r"C:\Temp\ContainmentAssociations.csv")
ExportAssociations example 4 (Python window)

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

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics