Set Association Role (Utility Network)

Summary

Alters the association role assigned to a network feature class or table at the asset type level.

Association roles define how certain features participate in a utility network. A utility network has existing system-provided association roles for structures and containers. For features to be set as containers or structures using associations, it is necessary to first set an association role. This is assigned at the feature class or table level for specific asset groups and asset types.

Learn more about how to set or modify an association role assignment

Usage

  • The view scale and deletion semantics for an asset type's role can be defined or updated with this tool.

  • The network topology must be disabled.

  • Unassigning container or structure association roles can only be performed before the network topology is enabled for the first time. Review Utility network management tasks for other examples and their required network topology state.

  • 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.SetAssociationRole(in_utility_network, domain_network, featureclass, assetgroup, assettype, association_role_type, association_deletion_semantics, {view_scale}, {split_content})
ParameterExplanationData Type
in_utility_network

The utility network that contains the asset type with an association role to set.

Utility Network; Utility Network Layer
domain_network

The domain network that contains the asset type with an association role to set.

String
featureclass

The utility network feature class or table where the association role will be set.

String
assetgroup

The asset group that contains the asset type.

String
assettype

The asset type that the association role will be set for.

String
association_role_type

Specifies the type of association role to assign to the asset type.

  • CONTAINERFeatures of this asset type can contain other features as content.
  • STRUCTUREFeatures of this asset type can have other features attached to them.
  • NONENo role type. These are features that are neither a container nor a structure but do connect to other structures.
String
association_deletion_semantics

Specifies the deletion semantics for the features; how child features are handled when the parent feature is deleted. This applies to both container and structure association roles.

  • CASCADEWhen the parent container or structure is deleted, all content or attachment features are deleted.
  • SET_TO_NONE When a container or structure is deleted, its content or attachment features are not deleted; instead, it is removed from the containment or structural attachment association.
  • RESTRICTED If content or attachment features exist, an error is returned when attempting to delete the container or structure. The content or attachment features must be removed before deleting the container or structure.
String
view_scale
(Optional)

The scale at which to enter containment mode to edit features participating in the container. For example, setting the view scale to 5 means that when you enter containment mode of the container feature, the scale will be 1:5. Units are based on the utility network units, which are located on the Source tab of the utility network layer properties pane.

Double
split_content
(Optional)

Specifies what happens to the associated content of a container if the container feature is split. This parameter is only available if the association role is container and is only applicable for line features.

  • SPLITSplit the container's content if the container feature is split. If a parallel content line feature is found, the content is also split and each section will be contained by the closest container feature. If the content line is not parallel, the content will be contained by the container feature that is closest to it.
  • DO_NOT_SPLITDo not split the container's content if the container feature is split. If a parallel content line feature is found, the content will be contained by both sections of the container feature. If the content line is not parallel, the content will be contained by the container feature that is closest to it. This is the default.
Boolean

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network.

Utility Network

Code sample

SetAssociationRole example (Python window)

Set the container association role for the asset type transformer. The view scale has been set to 10, and the deletion semantics are restricted.

import arcpy
arcpy.SetAssociationRole_un("Utility Network", "ElectricDistribution", 
                            "ElectricDistributionAssembly", "Transformer Bank", 
                            "Transformer", "CONTAINER", "RESTRICTED", 10)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics