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 network features participate in a utility network. A utility network has existing system-provided association roles for structures and containers. For a network feature to be set as a container or structure using associations, it is necessary to first set an association role. This is assigned at the feature class or object 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 done before the network topology is enabled for the first time. See Utility network management tasks for additional 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 parameter value must be from a database connection established as the database utility network owner.

Parameters

LabelExplanationData Type
Input 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
Input Table

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

String
Asset Group

The asset group that contains the asset type.

String
Asset Type

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

String
Role Type

Specifies the type of association role that will be assigned to the asset type.

  • ContainerThe container association role type will be assigned. Features or objects of this role type can contain other features and objects as content.
  • StructureThe structure association role type will be assigned. Features or objects of this role type can have other features and objects attached to them.
  • NoneNo role type will be assigned. These are features or objects that are neither a container nor a structure but do connect to other structures.
String
Deletion Semantics

Specifies the deletion semantics for the network features, which defines how content or attachment network features will be managed when the container or structure is deleted. This applies to both container and structure association roles.

  • CascadeWhen the container or structure is deleted, all content or attachment network features will be deleted.
  • Set to none When a container or structure is deleted, its content or attachment network features are not deleted, but are removed from the containment or structural attachment association.
  • Restricted If content or attachment network features exist, an error will be returned when attempting to delete the container or structure. The content or attachment network features must be removed before deleting the container or structure.
String
View Scale
(Optional)

The scale at which containment mode will be entered 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. This property does not apply to junction and edge objects.

Double
Split Content
(Optional)

Specifies whether the associated content of a container will be split if the container feature is split. This parameter is only available if the association role is container and is only applicable for line features.

  • Checked—The container's content will be split 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.
  • Unchecked—The container's content will not be split 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

LabelExplanationData Type
Updated Utility Network

The updated utility network.

Utility Network

arcpy.un.SetAssociationRole(in_utility_network, domain_network, featureclass, assetgroup, assettype, association_role_type, association_deletion_semantics, {view_scale}, {split_content})
NameExplanationData 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 that will be assigned to the asset type.

  • CONTAINERThe container association role type will be assigned. Features or objects of this role type can contain other features and objects as content.
  • STRUCTUREThe structure association role type will be assigned. Features or objects of this role type can have other features and objects attached to them.
  • NONENo role type will be assigned. These are features or objects that are neither a container nor a structure but do connect to other structures.
String
association_deletion_semantics

Specifies the deletion semantics for the network features, which defines how content or attachment network features will be managed when the container or structure is deleted. This applies to both container and structure association roles.

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

The scale at which containment mode will be entered 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. This property does not apply to junction and edge objects.

Double
split_content
(Optional)

Specifies whether the associated content of a container will be split if the container feature is split. This parameter is only available if the association role is container and is only applicable for line features.

  • SPLITThe container's content will be split 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_SPLITThe container's content will not be split 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.un.SetAssociationRole("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