Summary
Adds a diagram rule that automatically collapses container contents during the building of diagrams based on an existing template. This rule collapses the entire contents of containers 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 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 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 Input Network parameter value must be from a database connection established as the database utility network owner or database trace network owner.
- The connected ArcGIS Enterprise portal account must be the portal utility network owner or portal trace network owner.
- This tool must be connected to the default version, which is expected to be public and not protected.
The Collapse Container rule is used to simplify diagrams by collapsing all contents related to containers that may exist in diagrams.
This tool is used to configure the Collapse Container rule to either collapse all container contents in the diagram that are based on specified container source classes or object tables or 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—that is, with the Exclude source classes option in the Rule Process parameter and the Both junction and edges option in the Container Type parameter (rule_process = "EXCLUDE_SOURCE_CLASSES" and container_type = "BOTH" in Python) and no source container classes or object tables are specified—the Collapse Container rule will collapse all contents in the generated diagrams regardless of the network source container class or object table they are related to.
Syntax
arcpy.nd.AddCollapseContainerRule(in_utility_network, template_name, is_active, container_type, inverse_source_selection, {container_sources}, {description}, {reconnected_edges_option})
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 |
container_type | Specifies the geometry type of the container source class or object table the rule will process.
| String |
inverse_source_selection | Specifies how the rule will process the specified container source classes and object tables.
| String |
container_sources [container_sources,...] (Optional) | The container source class (or classes) and object table (or tables) that will be excluded or included during the Collapse Container rule execution depending on the chosen rule process. If Rule Process is Exclude source classes (inverse_source_selection = "EXCLUDE_SOURCE_CLASSES" in Python), the rule can be configured without specifying a particular network source class or object table, in which case it will collapse contents of any container source classes and object tables in the generated diagrams. However, if Rule Process is Include source classes (inverse_source_selection = "INCLUDE_SOURCE_CLASSES" in Python), the particular container source class (or classes) or object table (or tables) to be collapsed must be specified. When Exclude source classes (inverse_source_selection = "EXCLUDE_SOURCE_CLASSES" in Python), 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, while 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 Include Source Classes (inverse_source_selection = "INCLUDE_SOURCE_CLASSES" in Python), 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, while 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 the rule will aggregate the edges that are reconnected to the collapsed junctions.
| Boolean |
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
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 tool.
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.AddCollapseContainerRule_nd(input_Network, input_DiagramTemplate,
'ACTIVE', 'BOTH', 'EXCLUDE_SOURCE_CLASSES',
input_DoNotCollapseSourceClass, None,
'AGGREGATE_RECONNECTED_EDGES')
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes