Summary
Adds a diagram rule to the rule list specified on a diagram template to automatically collapse all contents related to containers during diagram building. The containers with the contents to be collapsed are identified using a SQL query based on their attributes.
Learn more about the collapsing of containers in network diagrams
Caution:
This tool is a configuration and administration tool that must be run by the database owner of the utility network through a direct connection to the default version. In addition to that requirement, the connected portal account must be the owner of the utility network to perform this operation. This essentially forms two-factor authentication.
Usage
The Collapse Container rule is used to simplify diagrams by collapsing all content related to containers that may exist in diagrams.
This tool allows you to configure the Collapse Container rule to run by attributes. This means you can configure the collapse of diagram features of a particular container class by filtering the container features to collapse based on their attributes.
Syntax
AddCollapseContainerByAttributeRule_un (in_utility_network, template_name, is_active, container_source, {where_clause}, {description}, {reconnected_edges_option})
Parameter | Explanation | Data Type |
in_utility_network | The utility network referencing the diagram template to modify. | Utility Network |
template_name | The name of the diagram template to modify. | String |
is_active | Specifies whether the rule is enabled when generating and updating diagrams based on the specified template.
| Boolean |
container_source | The network container source class that references the containers with the contents to be collapsed during the Collapse Container rule process. | Feature Class |
where_clause (Optional) | An SQL expression used to select the subset of containers in this source class with the contents to be collapsed in the generated diagrams. For more information on 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 must aggregate the edges that should be reconnected to the collapsed junctions or not.
| Boolean |
Derived Output
Name | Explanation | Data Type |
out_utility_network | The updated utility network. | Utility Network |
out_template_name | The name of the network template. | String |
Code sample
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 any structure device container in the generated diagram will be collapsed except substation ASSETGROUP<>8.
import arcpy
input_UtilityNetwork = "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_un(input_UtilityNetwork, input_DiagramTemplate,
"ACTIVE", input_StructureDeviceToCollapse,
"ASSETGROUP <> 8", '', 'AGGREGATE_RECONNECTED_EDGES')
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes
Related topics
- An overview of the Utility Network toolbox
- An overview of the Network Diagrams toolset
- An overview of the Configuration toolset
- Add Angle Directed Layout
- Add Collapse Container Rule
- Add Compression Layout
- Add Connectivity Associations Rule
- Add Diagram Template
- Add Expand Container By Attribute Rule
- Add Expand Container Rule
- Add Force Directed Layout
- Add Grid Layout
- Add Linear Dispatch Layout
- Add Mainline Tree Layout
- Add Partial Overlapping Edges Layout
- Add Radial Tree Layout
- Add Reduce Edge By Attribute Rule
- Add Reduce Junction By Attribute Rule
- Add Reduce Junction Rule
- Add Remove Feature By Attribute Rule
- Add Remove Feature Rule
- Add Reshape Diagram Edges Layout
- Add Set Root Junction By Attribute Rule
- Add Smart Tree Layout
- Add Spatial Dispatch Layout
- Add Start Iteration Rule
- Add Stop Iteration Rule
- Add Structural Attachments Rule
- Add Trace Rule
- Alter Diagram Template
- Create Diagram Layer Definition
- Delete Diagram Template
- Export Diagram Layer Definition
- Export Diagram Template Definitions
- Get Diagram Template Names
- Import Diagram Template Definitions