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 until they are updated.
Usage
This tool is not supported when working with a utility network service. You must work with either a utility network or trace network in a file geodatabase or a database connection to a utility network in an enterprise geodatabase. When working with an enterprise geodatabase, the connection must be established as the database utility network owner.
When performing this operation on a utility network in an enterprise geodatabase, the connected ArcGIS Enterprise portal account must be the portal utility network owner.
The network data element specified for the input network parameter must be from either a utility network or trace network in a file geodatabase or a database connection to a utility network in an enterprise geodatabase.
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.
Syntax
AddExpandContainerRule(in_utility_network, template_name, is_active, containers_visibility, container_type, inverse_source_selection, {container_sources}, {description})
Parameter | Explanation | Data Type |
in_utility_network | The utility network or trace network containing the diagram template to modify. | Utility Network; Trace Network |
template_name | The name of the diagram template to modify. | String |
is_active | Specifies whether the rule will be enabled when generating and updating diagrams based on the specified template.
| Boolean |
containers_visibility | Specifies whether the containers stay visible after they are expanded.
| Boolean |
container_type | Specifies the geometry type of the container source class or object table to be processed.
| String |
inverse_source_selection | Specifies how the specified container source classes and object tables will be processed.
| 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
Name | Explanation | Data 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
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
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes