Add Expand Container By Category Rule (Network Diagram)

Summary

Adds a diagram rule to automatically expand container contents during the building of diagrams based on an existing template. This expansion depends on whether the containers are tagged with specific network categories.

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.

Note:

This tool only applies to diagram templates in Utility Network version 7 and later.

Usage

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

    • The Input Network parameter value must be from a database connection established as the database utility network owner.
    • The connected ArcGIS Enterprise portal account must be the portal utility network owner.
    • This tool must be connected to the default version, which is expected to be public and not protected.

  • 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 specific network container features or objects represented in diagrams. This tool allows you to configure the Expand Container rule to run by network categories. This means that you can configure the expansion of network containers in the generated diagrams depending on whether they are tagged with specific network categories.

Parameters

LabelExplanationData Type
Input Network

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

Utility 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 element the rule will process.

  • Junctions only The Expand Container rule will process the junction and junction object containers only.
  • Edges only The Expand Container rule will process the edge and edge object containers only. Only the linear container will be processed
  • Both junctions and edges The Expand Container rule will process any container features and objects regardless of their type. Both junction and edge types will be processed. This is the default
String
Rule Process

Specifies how the containers that are tagged with the specified network categories will be processed.

  • Exclude categoriesContainers that are tagged with the specified network categories will not be expanded, while other containers will be expanded. This is the default.
  • Include categoriesContainers that are tagged with the specified network categories will be expanded.
String
Categories

The network categories that will be excluded or included depending on the Rule Process parameter value.

If the Rule Process parameter is set to Include categories, one or more network categories must be specified. All containers that are tagged with the specified categories will be expanded in the generated diagrams.

If the Rule Process parameter is set to Exclude categories, the contents related to any containers that are tagged with the specified categories will not be expanded in the generated diagrams, while contents related to containers that are not tagged with the specified categories will be expanded.

String
Description
(Optional)

The description of the rule.

String

Derived Output

LabelExplanationData Type
Output Network

The updated utility network.

Utility Network
Output Diagram Template

The name of the diagram template.

String

arcpy.nd.AddExpandContainerByCategoryRule(in_utility_network, template_name, is_active, containers_visibility, container_type, inverse_category_selection, category, {description})
NameExplanationData Type
in_utility_network

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

Utility 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 element the rule will process.

  • JUNCTIONS The Expand Container rule will process the junction and junction object containers only.
  • EDGES The Expand Container rule will process the edge and edge object containers only. Only the linear container will be processed
  • BOTH The Expand Container rule will process any container features and objects regardless of their type. Both junction and edge types will be processed. This is the default
String
inverse_category_selection

Specifies how the containers that are tagged with the specified network categories will be processed.

  • EXCLUDE_CATEGORIESContainers that are tagged with the specified network categories will not be expanded, while other containers will be expanded. This is the default.
  • INCLUDE_CATEGORIESContainers that are tagged with the specified network categories will be expanded.
String
category
[category,...]

The network categories that will be excluded or included depending on the inverse_category_selection parameter value.

If the inverse_category_selection parameter is set to INCLUDE_CATEGORIES, one or more network categories must be specified. All containers that are tagged with the specified categories will be expanded in the generated diagrams.

If the inverse_category_selection parameter is set to EXCLUDE_CATEGORIES, the contents related to any containers that are tagged with the specified categories will not be expanded in the generated diagrams, while contents related to containers that are not tagged with the specified categories will be expanded.

String
description
(Optional)

The description of the rule.

String

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network.

Utility Network
out_template_name

The name of the diagram template.

String

Code sample

AddExpandContainerByCategoryRule example (stand-alone script)

Add an Expand Container rule to the MyTemplate1 template to expand all linear containers with the category 'Duct Bank' using the AddExpandContainerByCategoryRule function.

import arcpy
input_Network = 'D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric'
input_DiagramTemplate = 'MyTemplate1'
input_Category = 'Duct Bank'

arcpy.nd.AddExpandContainerByCategoryRule(
    input_Network, input_DiagramTemplate, 'ACTIVE', 'EDGES',
    'INCLUDE_CATEGORIES', input_Category)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics