Alter Diagram Template (Network Diagram)

Summary

Alters the properties of a diagram template.

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 the template works with vertices along input network edges
  • Specifying whether reflexive connectivity associations are kept for the generated diagrams
  • Specifying whether linear containers must be removed from the generated diagrams
  • Defining the margin size between containers and their contents
  • Defining the radius of the reflexive connectivity associations
  • Disabling the storage capability for those diagrams
  • Enabling the extend diagram capabilities

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 Diagram to update until they are updated.

Caution:

This tool is a configuration and administration tool.

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 or mobile 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 network data element specified for the Input Network parameter must be from either a utility network or trace network in a file or mobile geodatabase, or a database connection to a utility network or trace network in an enterprise geodatabase.

  • 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 apply 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 operation; they use 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.

Parameters

LabelExplanationData Type
Input Network

The utility network or trace network of the diagram template that will be altered.

Utility Network; Trace Network
Input Diagram Template

The name of the diagram template that will be altered.

String
New Template Name
(Optional)

The new name of the template.

String
Default template
(Optional)

Specifies the default status of the input template.

  • Checked—The input diagram template will be the default template.
  • Unchecked—The input diagram template will not be the default template. This is the default.

The default template is used when generating a diagram if no template is specified. It is also the template used when clicking New or Use Trace Locations in the Diagram group on the Utility Network or Trace Network tab set if no other template is specified.

Boolean
Remove the diagram template rule and layout definitions
(Optional)

Specifies whether the template rule and layout definitions will be removed.

  • Checked—The rule and layout definitions related to the input diagram template will be removed.
  • Unchecked—The rule and layout definitions related to the input diagram template will not be removed. This is the default.

Boolean
Keep initial vertices on edges
(Optional)

Specifies how vertices along the GIS edges will be managed in the diagrams based on the template.

  • Checked—All vertices that display along GIS edges will be preserved on the associated edges in each network diagram based on the template.
  • Unchecked—Diagram edges will be drawn as straight lines between their connected junctions. This is the default.
Note:

For performance quality, check this parameter only when needed. If the template is configured to run an automatic layout at diagram generation, for example, checking this option makes sense for the Relative Mainline and Partial Overlapping Edges diagram layouts. The other diagram layouts don't use diagram edges geometry.

Boolean
Container Margin
(Optional)

The minimum distance between the center of any junctions inside the container and the container border.

Linear Unit
Enable diagram storage
(Optional)

Specifies whether the diagrams based on the template can be stored.

  • Checked—The diagrams based on the template can be stored. This is the default.
  • Unchecked—The diagrams based on the template cannot be stored.
Boolean
Enable to extend diagram
(Optional)

Specifies whether the diagrams based on the template can be extended.

  • Checked—The diagrams based on the template can be extended by connectivity, traversability, containment, or attachment.
  • Unchecked—The diagrams based on the template cannot be extended. This is the default.
Boolean
Description
(Optional)

The description of the template.

String
Reset the diagram template layer definition to default
(Optional)

Specifies whether the diagram template layer definition will be reset to the default.

  • Checked—The diagram layer definition related to the input diagram template will be reset to the default (removed).
  • Unchecked—The diagram layer definition related to the input diagram template will not be removed. This is the default.

Boolean
Keep reflexive connectivity associations
(Optional)

Specifies whether reflexive connectivity associations will be kept at diagram building.

  • Checked—Reflexive connectivity associations will be kept at diagram building. This is the default.
  • Unchecked—Reflexive connectivity associations will be systematically removed at diagram building.

Boolean
Remove linear containers
(Optional)

Specifies whether linear containers will be removed at the completion of the diagram building.

  • Checked—Linear containers will be removed at the completion of the diagram building.
  • Unchecked—Linear containers in the generated diagram will be kept. This is the default.

Boolean
Reflexive Edge Radius
(Optional)

The minimum radius of the reflexive connectivity association edges. For multiple reflexive connectivity association edges on a junction, the reflexive edge radius increases 0.5 at each level.

Linear Unit

Derived Output

LabelExplanationData Type
Output Network

The updated utility network or trace network.

Utility Network; Trace Network
Output Diagram Template

The name of the diagram template.

String

arcpy.nd.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}, {are_reflexive_connectivity_associations_kept}, {are_linear_containers_removed}, {reflexive_edge_radius})
NameExplanationData Type
in_utility_network

The utility network or trace network of the diagram template that will be altered.

Utility Network; Trace Network
template_name

The name of the diagram template that will be altered.

String
out_name
(Optional)

The new name of the template.

String
is_default_template
(Optional)

Specifies the default status of the input template.

  • DEFAULT_TEMPLATEThe input diagram template will be the default template.
  • NOT_DEFAULT_TEMPLATEThe input diagram template will not be the default template. This is the default.

The default template is used when generating a diagram if no template is specified.

Boolean
are_rules_and_layouts_removed
(Optional)

Specifies whether the template rule and layout definitions will be removed.

  • REMOVE_RULES_AND_LAYOUTSThe rule and layout definitions related to the input diagram template will be removed.
  • DO_NOT_REMOVE_RULES_AND_LAYOUTSThe rule and layout definitions related to the input diagram template will not be removed. This is the default.
Boolean
are_vertices_kept
(Optional)

Specifies how vertices along the GIS edges will be managed in the diagrams based on the template.

  • KEEP_VERTICESAll vertices that display along GIS edges will be preserved on the associated edges in each network diagram based on the template.
  • DO_NOT_KEEP_VERTICESDiagram edges will be drawn as straight lines between their connected junctions. This is the default.
Note:

For performance quality, use the KEEP_VERTICES option only when needed. If the 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.

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.

  • ENABLE_DIAGRAM_STORAGEThe diagrams based on the template can be stored. This is the default.
  • DISABLE_DIAGRAM_STORAGEThe diagrams based on the template cannot be stored.
Boolean
is_diagram_extension_enabled
(Optional)

Specifies whether the diagrams based on the template can be extended.

  • ENABLE_DIAGRAM_EXTENSIONThe diagrams based on the template can be extended by connectivity, traversability, containment, or attachment.
  • DISABLE_DIAGRAM_EXTENSIONThe diagrams based on the template cannot be extended. This is the default.
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 the default.

  • REMOVE_LAYER_DEFINITIONSThe diagram layer definition related to the input diagram template will be reset to the default (removed).
  • DO_NOT_REMOVE_LAYER_DEFINITIONSThe diagram layer definition related to the input diagram template will not be removed. This is the default.
Boolean
are_reflexive_connectivity_associations_kept
(Optional)

Specifies whether reflexive connectivity associations will be kept at diagram building

  • KEEP_REFLEXIVE_CONNECTIVITY_ASSOCIATIONSReflexive connectivity associations will be kept at diagram building. This is the default.
  • DO_NOT_KEEP_REFLEXIVE_CONNECTIVITY_ASSOCIATIONSReflexive connectivity associations will be systematically removed at diagram building.
Boolean
are_linear_containers_removed
(Optional)

Specifies whether linear containers will be removed at the completion of the diagram building.

  • REMOVE_LINEAR_CONTAINERSLinear containers will be removed at the completion of the diagram building.
  • DO_NOT_REMOVE_LINEAR_CONTAINERSLinear containers in the generated diagram will be kept. This is the default.
Boolean
reflexive_edge_radius
(Optional)

The minimum radius of the reflexive connectivity association edges. For multiple reflexive connectivity association edges on a junction, the reflexive edge radius increases 0.5 at each level.

Linear Unit

Derived Output

NameExplanationData 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

AlterDiagramTemplate example (Python window)

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.nd.AlterDiagramTemplate(
    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",
    "KEEP_REFLEXIVE_CONNECTIVITY_ASSOCIATIONS",
    "DO_NOT_ REMOVE_LINEAR_CONTAINERS")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics