Summary
Alters the properties of a diagram template such as its name, how it handles vertices along input network edges, whether the related diagrams can be stored or extended, the margin between containers and their contents in these diagrams, the removal of its rule and layout, and the reset of the diagram layer definition to default.
Caution:
This tool is a configuration and administration tool.
When working with a utility network in an enterprise geodatabase, it must be run by the database utility network owner through a database connection to the default version. The default version must be public and not protected. In addition, the connected ArcGIS Enterprise portal account must be the portal utility network owner. This essentially forms two-factor authentication.
Note:
Changing the size of the container margin or removing the diagram rule and layout definitions causes the Consistency field value in the database to switch to inconsistent for any existing diagram based on the input diagram template. All of these diagrams remain 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.
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.
This tool supports the following specific diagram template property alterations:
- Changing the name of the template
- Setting a template as the default template
- Removing the rule and layout definitions
- Resetting the diagram layer definition to the default
- Specifying the way it works with vertices along input network edges
- Defining the margin size between containers and their contents
- Disabling the storage capability for those diagrams
- Enabling the extend diagram capabilities
Initializing vertices along diagram edges at diagram generation and managing them at diagram display is time consuming. To avoid impacting performance, check the Keep initial vertices on edges parameter only when needed. For example, if the template is configured to execute an automatic diagram layout at generation, check this parameter for theRelative Mainline and Partial Overlapping Edges diagram layouts. The other diagram layout types don't use vertices on diagram edges during their execution; they only deal with diagram junction positions.
Starting with ArcGIS Pro 2.6, this tool systematically initializes a default diagram layer definition for the input diagram template if it doesn't already exist.
When configuring a model to set up new rule and layout definitions for a diagram template, run the Alter Diagram Template tool with the Remove the diagram template rule and layout definitions parameter checked at the beginning of the model. This will cause the model to reinitialize the template properties to their default settings.
Syntax
AlterDiagramTemplate(in_utility_network, template_name, {out_name}, {is_default_template}, {are_rules_and_layouts_removed}, {are_vertices_kept}, {container_margin}, {is_diagram_storage_enabled}, {is_diagram_extension_enabled}, {description}, {are_layer_definitions_removed})
Parameter | Explanation | Data Type |
in_utility_network | The utility network or trace network of the diagram template to alter. | Utility Network; Trace Network |
template_name | The name of the diagram template to alter. | String |
out_name (Optional) | The new name of the template. | String |
is_default_template (Optional) | Specifies the default status of the template.
The default template is the one used when generating a diagram if a template is not specified. | Boolean |
are_rules_and_layouts_removed (Optional) | Specifies whether the template rule and layout definitions will be removed.
| Boolean |
are_vertices_kept (Optional) | Specifies how vertices along the GIS edges will be managed in the diagrams based on the template.
Note:For performance quality, use the KEEP_VERTICES option only when needed. If your template is configured to run an automatic layout at diagram generation, for example, the KEEP_VERTICES option makes sense for the Relative Mainline and Partial Overlapping Edges diagram layouts. The other diagram layouts don't use diagram edges geometry when they execute. | Boolean |
container_margin (Optional) | The minimum distance between the center of any junctions inside the container and the container border. | Linear Unit |
is_diagram_storage_enabled (Optional) | Specifies whether the diagrams based on the template can be stored.
| Boolean |
is_diagram_extension_enabled (Optional) | Specifies whether the diagrams based on the template can be extended.
| Boolean |
description (Optional) | The description of the template. | String |
are_layer_definitions_removed (Optional) | Specifies whether the diagram template layer definition will be reset to default.
| 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
This sample increases the container margin for any container belonging to diagrams based on the ExpandContainers template.
import arcpy
input_Network = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
arcpy.AlterDiagramTemplate_nd(input_Network, "ExpandContainers",
"ExpandContainers", "NOT_DEFAULT_TEMPLATE",
"DO_NOT_REMOVE_RULES_AND_LAYOUTS",
"KEEP_VERTICES", "0.3 Meters",
"ENABLE_DIAGRAM_STORAGE",
"DISABLE_DIAGRAM_EXTENSION",
None,
"DO_NOT_REMOVE_LAYER_DEFINITIONS")
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes