Summary
Adds a diagram rule to automatically expand container contents during diagram building based on an existing template. The containers to expand are filtered by attributes from a given container source class or object table.
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 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 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 allows you to configure the Expand Container rule to run by attributes. It allows configuring the expansion of diagram features based on a particular container source class or object table by filtering the container features or objects based on their attributes.
Syntax
arcpy.nd.AddExpandContainerByAttributeRule(in_utility_network, template_name, is_active, containers_visibility, container_source, {where_clause}, {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_source | The container source class or object table that references the containers to be expanded. | Table; Feature Class |
where_clause (Optional) | An SQL expression used to select the subset of containers in the container source class or object table that will be expanded in the generated diagrams. For more information on SQL syntax, see the SQL reference for query expressions used in ArcGIS help topic. | SQL Expression |
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
Add an Expand Container By Attribute rule to the MyTemplate1 template existing for a given network to expand structure junction containers that are not substation—ASSETTYPE <> 8—in the generated diagrams, meaning any structure junction container will be expanded in the generated diagram except substation.
import arcpy
input_Network = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DiagramTemplate = "MyTemplate1"
input_StructureJunctionToExpand = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.StructureJunction"
arcpy.AddExpandContainerByAttributeRule_nd(input_Network, input_DiagramTemplate,
"ACTIVE", "KEEP_VISIBLE",
input_StructureJunctionToExpand,
"ASSETTYPE <> 8")
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes