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
SetAssociationRole(in_utility_network, domain_network, featureclass, assetgroup, assettype, association_role_type, association_deletion_semantics, {view_scale}, {split_content})
Parameter | Explanation | Data 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.
| 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.
| 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.
| Boolean |
Derived Output
Name | Explanation | Data Type |
out_utility_network | The updated utility network. | Utility Network |
Code sample
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
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes