Add Collapse Container By Attribute Rule (Network Diagram)

Summary

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

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 May be inconsistent 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.

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

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 Source

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

Table; Feature Class
Expression
(Optional)

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

SQL Expression
Description
(Optional)

The description of the rule.

String
Aggregate reconnected edges
(Optional)

Specifies whether the rule will aggregate the edges that are reconnected to the collapsed container junctions.

  • 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.AddCollapseContainerByAttributeRule(in_utility_network, template_name, is_active, container_source, {where_clause}, {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_source

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

Table; Feature Class
where_clause
(Optional)

An SQL expression used to select the subset of containers in this source class or object table with the contents to be collapsed in the generated diagrams. For more information about 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 will aggregate the edges that are reconnected to the collapsed junctions.

  • 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

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 that any structure device container in the generated diagram will be collapsed except substation ASSETGROUP<>8.

import arcpy
input_Network = "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_nd(input_Network, 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