Skip To Content

Add Collapse Container By Attribute Rule

Summary

Adds a diagram rule to the rule list specified on a diagram template to automatically collapse all contents related to containers during diagram building. The containers with the contents to be collapsed are identified using a SQL query based on their attributes.

Learn more about the collapsing of containers in network diagrams

Caution:

This tool is a configuration and administration tool that must be run by the database owner of the utility network through a direct connection to the default version. In addition to that requirement, the connected portal account must be the owner of the utility network to perform this operation. This essentially forms two-factor authentication.

Usage

  • The Collapse Container rule is used to simplify diagrams by collapsing all content related to containers that may exist in diagrams.

    This tool allows you to configure the Collapse Container rule to run by attributes. This means you can configure the collapse of diagram features of a particular container class by filtering the container features to collapse based on their attributes.

Syntax

AddCollapseContainerByAttributeRule_un (in_utility_network, template_name, is_active, container_source, {where_clause}, {description}, {reconnected_edges_option})
ParameterExplanationData Type
in_utility_network

The utility network referencing the diagram template to modify.

Utility Network
template_name

The name of the diagram template to modify.

String
is_active

Specifies whether the rule is enabled when generating and updating diagrams based on the specified template.

  • ACTIVEThe added rule becomes enabled during the generation and update of any diagrams based on the input template. This is the default.
  • INACTIVEThe added rule is not enabled during the generation or update of any diagrams based on the input template.
Boolean
container_source

The network container source class that references the containers with the contents to be collapsed during the Collapse Container rule process.

Feature Class
where_clause
(Optional)

An SQL expression used to select the subset of containers in this source class with the contents to be collapsed in the generated diagrams. For more information on SQL syntax, see SQL reference for query expressions used in ArcGIS.

SQL Expression
description
(Optional)

The description of the rule.

String
reconnected_edges_option
(Optional)

Specifies whether the rule must aggregate the edges that should be reconnected to the collapsed junctions or not.

  • DONT_AGGREGATE_RECONNECTED_EDGESAny edge connecting a content junction is kept and simply reconnected to the collapsed container junction.
  • AGGREGATE_RECONNECTED_EDGESAny edge connecting a content junction is replaced by a reduction edge that is reconnected to the collapsed container junction. Moreover, multiple edges between two collapsed junctions are systematically aggregated under the same reduction edge. This is the default.
Boolean

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network.

Utility Network
out_template_name

The name of the network template.

String

Code sample

AddCollapseContainerByAttributeRule example (stand-alone script)

Add a Collapse Container By Attribute rule to the MyTemplate1 template to collapse contents in any structure junction containers that are not substation ASSETGROUP<>8 in the generated diagrams. This means any structure device container in the generated diagram will be collapsed except substation ASSETGROUP<>8.

import arcpy
input_UtilityNetwork = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DiagramTemplate = "MyTemplate1"
input_StructureDeviceToCollapse = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.StructureJunction"

arcpy.AddCollapseContainerByAttributeRule_un(input_UtilityNetwork, input_DiagramTemplate, 
                                             "ACTIVE", input_StructureDeviceToCollapse, 
                                             "ASSETGROUP <> 8", '', 'AGGREGATE_RECONNECTED_EDGES')

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics