Add Expand Container Rule (Network Diagram)

Summary

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

Learn more about expanding 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 Expand Container rule is used to expand diagrams by adding content features or objects that adhere to the following:

    • They are contained in a container in the diagram input.
    • They share the same container as content in the diagram input.

    The Expand Container rule expands the containers by source class or object table and, optionally, filters them based on their attributes.

    This tool is used to configure the Expand Container rule to expand all containers in the diagram that are based on specified container source classes and object tables. It can also be used to expand all containers in the diagram except those based on the specified container source classes and object tables.

    When it is configured by default—Rule Process set to Exclude source classes and Container Type set to Both junctions and edges (rule_process = "EXCLUDE_SOURCE_CLASSES" and container_type = "BOTH" in Python) and no container source classes or object tables are specified—each container in the generated diagrams will be expanded regardless of the container source class or object table on which it is based.

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
Keep containers visible

Specifies whether the containers stay visible after they are expanded.

  • Checked—The containers will stay visible after they are expanded. This is the default.
  • Unchecked—The containers will be hidden after they are expanded.

Boolean
Container Type

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

  • Junctions onlyOnly junction container source classes or object tables (polygon container source classes, point container source classes, or container junction object tables) will be processed.
  • Edges onlyOnly edge container source classes or 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 based on the specified source classes and object tables will not be expanded, while other containers will be expanded. This is the default.
  • Include source classesContainers based on the specified source classes and object tables will be expanded.
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 (inverse_source_selection = "EXCLUDE_SOURCE_CLASSES" in Python), no particular container source class or object table can be specified. In this case, all containers in the generated diagrams regardless of their source class or object table will be expanded. When Rule Process is set to Include source classes (inverse_source_selection = "INCLUDE_SOURCE_CLASSES" in Python), the particular container source class (or classes) and object table (or tables) to be expanded must be specified.

When running the Exclude source classes option (inverse_source_selection = "EXCLUDE_SOURCE_CLASSES" in Python), the containers belonging to the specified source classes or object tables will not be expanded in the generated diagrams; however, container features and container objects that don't belong to those source classes and tables will be expanded. Conversely, when running the Include source classes option (inverse_source_selection = "INCLUDE_SOURCE_CLASSES" in Python), the containers belonging to the specified source classes and object tables will be expanded in the generated diagrams; however, container features and container objects that don't belong to those source classes and object tables will not be expanded.

Table; Feature Class
Description
(Optional)

The description of the rule.

String

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.AddExpandContainerRule(in_utility_network, template_name, is_active, containers_visibility, container_type, inverse_source_selection, {container_sources}, {description})
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
containers_visibility

Specifies whether the containers stay visible after they are expanded.

  • KEEP_VISIBLE The containers will stay visible after they are expanded. This is the default.
  • HIDE The containers will be hidden after they are expanded.
Boolean
container_type

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

  • JUNCTIONSOnly junction container source classes or object tables (polygon container source classes, point container source classes, or container junction object tables) will be processed.
  • EDGESOnly edge container source classes or 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 based on the specified source classes and object tables will not be expanded, while other containers will be expanded. This is the default.
  • INCLUDE_SOURCE_CLASSESContainers based on the specified source classes and object tables will be expanded.
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 Rule Process is set to Exclude source classes (inverse_source_selection = "EXCLUDE_SOURCE_CLASSES" in Python), no particular container source class or object table can be specified. In this case, all containers in the generated diagrams regardless of their source class or object table will be expanded. When Rule Process is set to Include source classes (inverse_source_selection = "INCLUDE_SOURCE_CLASSES" in Python), the particular container source class (or classes) and object table (or tables) to be expanded must be specified.

When running the Exclude source classes option (inverse_source_selection = "EXCLUDE_SOURCE_CLASSES" in Python), the containers belonging to the specified source classes or object tables will not be expanded in the generated diagrams; however, container features and container objects that don't belong to those source classes and tables will be expanded. Conversely, when running the Include source classes option (inverse_source_selection = "INCLUDE_SOURCE_CLASSES" in Python), the containers belonging to the specified source classes and object tables will be expanded in the generated diagrams; however, container features and container objects that don't belong to those source classes and object tables will not be expanded.

Table; Feature Class
description
(Optional)

The description of the rule.

String

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

AddExpandContainerRule example (Python window)

Using the AddExpandContainerRule tool, add an Expand Container rule to the MyTemplate1 template for a given network to expand all containers in the generated diagrams regardless of their source class or object table, except those belonging to the electric distribution assembly source class .

import arcpy
input_Network = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DiagramTemplate = "MyTemplate1"
input_DoNotExpandSourceClass = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.ElectricDistributionAssembly"

arcpy.AddExpandContainerRule_nd(input_Network, input_DiagramTemplate, 
                                'ACTIVE', 'KEEP_VISIBLE', 'BOTH', 
                                'EXCLUDE_SOURCE_CLASSES', 
                                input_DoNotExpandSourceClass)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics