Export Associations (Utility Network)

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.

Learn more about how to export associations

Usage

  • When working with an enterprise geodatabase, the Input Utility Network parameter value 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.

Parameters

LabelExplanationData Type
Input Utility Network

The utility network containing the associations to export.

Utility Network; Utility Network Layer
Association Type

Specifies the type of association to export.

  • AllAll association types in the utility network will be exported to a .csv file.
  • Junction-junction connectivityConnectivity associations allowing two junction subtypes to connect via a connectivity association (features are offset geometrically) will be exported to a .csv file.
  • ContainmentThe containment association type will be exported to a .csv file.
  • AttachmentThe structural attachment association type will be exported to a .csv file.
  • Junction-edge connectivity (from side of edge)The junction-edge (from side of edge) connectivity association type will be exported to a .csv file.
  • Junction-edge connectivity (midspan)The junction-edge (midspan) connectivity association type will be exported to a .csv file.
  • Junction-edge connectivity (to side of edge)The junction-edge (to side of edge) connectivity association type will be exported to a .csv file.
String
Output File

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

File

arcpy.un.ExportAssociations(in_utility_network, association_type, out_csv_file)
NameExplanationData 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.

  • ALLAll association types in the utility network will be exported to a .csv file.
  • JUNCTION_JUNCTION_CONNECTIVITYConnectivity associations allowing two junction subtypes to connect via a connectivity association (features are offset geometrically) will be exported to a .csv file.
  • CONTAINMENTThe containment association type will be exported to a .csv file.
  • STRUCTURAL_ATTACHMENTThe structural attachment association type will be exported to a .csv file.
  • JUNCTION_EDGE_FROM_CONNECTIVITYThe junction-edge (from side of edge) connectivity association type will be exported to a .csv file.
  • JUNCTION_EDGE_MIDSPAN_CONNECTIVITYThe junction-edge (midspan) connectivity association type will be exported to a .csv file.
  • JUNCTION_EDGE_TO_CONNECTIVITYThe junction-edge (to side of edge) connectivity association type will be 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.un.ExportAssociations("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.un.ExportAssociations("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.un.ExportAssociations("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.un.ExportAssociations("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