Add Collapse Container Rule (Network Diagram)

Summary

Adds a diagram rule to the rule sequence specified on a diagram template to automatically collapse container contents during diagram buildings. This rule collapses all of the container contents in the diagrams.

Learn more about collapsing containers in network diagrams

Caution:

This tool is a configuration and administration tool.

Note:

This tool impacts the consistency of any existing diagrams based on the input diagram template. All of the existing diagrams become inconsistent and open with a consistency warning icon Diagram to update until they are updated.

Usage

  • This tool is not supported when working with a utility network or trace network service. You must use either a utility network or trace network in a file or mobile geodatabase, or a database connection to a utility network or trace network in an enterprise geodatabase. When working with an enterprise geodatabase, the following are requirements:

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

    You can use this tool to configure the Collapse Container rule to collapse all container contents in the diagram that are based on specified container source classes and object tables. You can also use it to collapse all container contents in the diagram except those based on the specified container source classes or object tables.

    When it is configured by default—the Rule Process parameter set to Exclude source classes and the Container Type parameter set to Both junctions and edges and no source container classes or object tables are specified—all contents in the generated diagrams will be collapsed regardless of the network source container class or object table they are related to.

Parameters

LabelExplanationData Type
Input Network

The utility network or trace network containing the diagram template that will be modified.

Utility Network; Trace Network
Input Diagram Template

The name of the diagram template that will be modified.

String
Active

Specifies whether the rule will be active when generating and updating diagrams based on the specified template.

  • Checked—The added rule will become active during the generation and update of any diagrams based on the input template. This is the default.
  • Unchecked—The added rule will not become active during the generation or update of any diagrams based on the input template.

Boolean
Container Type

Specifies the geometry type of the container source class or object table that will be processed.

  • Junctions onlyOnly junction container source classes and object tables (polygon container source classes, point container source classes, and container junction object tables) will be processed.
  • Edges onlyOnly edge container source classes and object tables (linear container source classes or container edge object tables) will be processed.
  • Both junctions and edgesAll container source classes and object tables regardless of their type (both junction and edge types) will be processed. This is the default.
String
Rule Process

Specifies how the specified container source classes and object tables will be processed.

  • Exclude source classesContainers that are based on the specified source classes and object tables will not be collapsed, while other containers will be collapsed. This is the default.
  • Include source classesContainers that are based on the specified source classes and object tables will be collapsed.
String
Container Sources
(Optional)

The container source class (or classes) and object table (or tables) that will be excluded or included depending on the rule process.

When Rule Process is set to Exclude source classes, the rule can be configured without specifying a network source class or object table. In this case, it will collapse contents of any container source classes and object tables in the generated diagrams. When Rule Process is set to Include source classes, the container source class (or classes) or object table (or tables) to be collapsed must be specified.

When Rule Process is set to Exclude source classes, the contents related to any container features or container objects belonging to the specified classes or object tables will not be collapsed in the generated diagrams; however, contents related to container features and container objects that don't belong to those classes and object tables will be collapsed. Conversely, when Rule Process is set to Include source classes , the contents related to any container features and container objects belonging to the specified source classes and object tables will be collapsed in the generated diagrams; however, contents related to container features and container objects that don't belong to those source classes and object tables will not be collapsed.

Table; Feature Class
Description
(Optional)

The description of the rule.

String
Aggregate reconnected edges
(Optional)

Specifies whether edges that are reconnected to the collapsed container junctions will be aggregated.

  • Unchecked—Any edge connecting a content junction will be kept and reconnected to the collapsed container junction.
  • Checked—Any edge connecting a content junction will be replaced by a reduction edge that is reconnected to the collapsed container junction. Multiple edges between two collapsed junctions will be systematically aggregated under the same reduction edge. This is the default.

Boolean

Derived Output

LabelExplanationData Type
Output Network

The updated utility network or trace network.

Utility Network; Trace Network
Output Diagram Template

The name of the diagram template.

String

arcpy.nd.AddCollapseContainerRule(in_utility_network, template_name, is_active, container_type, inverse_source_selection, {container_sources}, {description}, {reconnected_edges_option})
NameExplanationData Type
in_utility_network

The utility network or trace network containing the diagram template that will be modified.

Utility Network; Trace Network
template_name

The name of the diagram template that will be modified.

String
is_active

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

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

Specifies the geometry type of the container source class or object table that will be processed.

  • JUNCTIONSOnly junction container source classes and object tables (polygon container source classes, point container source classes, and container junction object tables) will be processed.
  • EDGESOnly edge container source classes and object tables (linear container source classes or container edge object tables) will be processed.
  • BOTHAll container source classes and object tables regardless of their type (both junction and edge types) will be processed. This is the default.
String
inverse_source_selection

Specifies how the specified container source classes and object tables will be processed.

  • EXCLUDE_SOURCE_CLASSESContainers that are based on the specified source classes and object tables will not be collapsed, while other containers will be collapsed. This is the default.
  • INCLUDE_SOURCE_CLASSESContainers that are based on the specified source classes and object tables will be collapsed.
String
container_sources
[container_sources,...]
(Optional)

The container source class (or classes) and object table (or tables) that will be excluded or included depending on the rule process.

When inverse_source_selection = "EXCLUDE_SOURCE_CLASSES", the rule can be configured without specifying a network source class or object table. In this case, it will collapse contents of any container source classes and object tables in the generated diagrams. When inverse_source_selection = "INCLUDE_SOURCE_CLASSES", the container source class (or classes) or object table (or tables) to be collapsed must be specified.

When inverse_source_selection = "EXCLUDE_SOURCE_CLASSES", the contents related to any container features or container objects belonging to the specified classes or object tables will not be collapsed in the generated diagrams; however, contents related to container features and container objects that don't belong to those classes and object tables will be collapsed. Conversely, when inverse_source_selection = "INCLUDE_SOURCE_CLASSES", the contents related to any container features and container objects belonging to the specified source classes and object tables will be collapsed in the generated diagrams; however, contents related to container features and container objects that don't belong to those source classes and object tables will not be collapsed.

Table; Feature Class
description
(Optional)

The description of the rule.

String
reconnected_edges_option
(Optional)

Specifies whether edges that are reconnected to the collapsed junctions will be aggregated.

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

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network or trace network.

Utility Network; Trace Network
out_template_name

The name of the diagram 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 and object table, except those belonging to the structure junction source class, using the AddCollapseContainerRule function.

import arcpy
input_Network = "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.nd.AddCollapseContainerRule(input_Network, input_DiagramTemplate, 
                                  'ACTIVE', 'BOTH', 'EXCLUDE_SOURCE_CLASSES', 
                                  input_DoNotCollapseSourceClass, None,
                                  'AGGREGATE_RECONNECTED_EDGES')

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics