Skip To Content

Add Collapse Container Rule

Summary

Adds a diagram rule that automatically collapses container contents during the building of diagrams based on an existing template. This rule collapses the entire contents of containers in the diagrams.

Learn more about collapsing 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 is used to configure the Collapse Container rule to either collapse all container contents in the diagram that are based on specified network container classes or collapse all container contents in the diagram except those based on the specified network container classes.

    When it is configured by default—that is, with the Exclude source classes rule process on the Both junction and edges container type (rule_process=EXCLUDE_SOURCE_CLASSES and container_type=BOTH in Python) and no source container classes specified—the Collapse Container rule will collapse all contents in the generated diagrams regardless of the network source container class they are related to.

Syntax

AddCollapseContainerRule_un (in_utility_network, template_name, is_active, container_type, inverse_source_selection, {container_sources}, {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_type

The geometry type of the source class container the rule must process.

  • JUNCTIONSThe Collapse Container rule process will focus on the junction container source classes only; that is, the utility network polygon or point container source classes.
  • EDGESThe Collapse Container rule process will focus on the edge container source classes only; that is, the utility network linear container source classes.
  • BOTHThe Collapse Container rule process will operate on any container source classes regardless of their type; that is, both junction and edge types will be processed. This is the default.
String
inverse_source_selection

Determines how the rule processes the specified container source classes.

  • EXCLUDE_SOURCE_CLASSESAny containers based on the specified source classes will not be collapsed, while other containers will be collapsed. This is the default.
  • INCLUDE_SOURCE_CLASSESAny containers based on the specified source classes will be collapsed.
String
container_sources
[container_sources,...]
(Optional)

The network container source class (or classes) that must be excluded or included during the Collapse Container rule execution depending on the chosen rule process.

With the Exclude Source Classes rule process, the rule can be configured without specifying any particular network source class, in which case it will collapse contents of any container source classes in the generated diagrams. However, with the Include Source Classes rule process, the particular container source class (or classes) to be collapsed must be specified.

When running the Exclude Source Classes rule process, the contents related to any network container features belonging to those classes will never be collapsed in the generated diagrams, while contents related to network container features that don't belong to those classes will be collapsed. Conversely, when running the Include Source Classes rule process, the contents related to any network container features belonging to those classes will always be collapsed in the generated diagrams, while contents related to network container features that don't belong to those classes will not be collapsed.

Feature Class
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

AddCollapseContainerRule example (stand-alone script)

Add a Collapse Container rule to the MyTemplate1 template to collapse all containers in the generated diagrams regardless of their source class, except those belonging to the structure junction source class, using the AddCollapseContainerRule tool.

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

arcpy.AddCollapseContainerRule_un(input_UtilityNetwork, input_DiagramTemplate, 
                                  'ACTIVE', 'BOTH', 'EXCLUDE_SOURCE_CLASSES', 
                                  input_DoNotCollapseSourceClass,,'AGGREGATE_RECONNECTED_EDGES')

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics