Alter Diagram Template (Network Diagram)

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.

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 May be inconsistent 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.

  • 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.

Parameters

LabelExplanationData Type
Input Network

The utility network or trace network of the diagram template to alter.

Utility Network; Trace Network
Input Diagram Template

The name of the diagram template to alter.

String
New Template Name
(Optional)

The new name of the template.

String
Default template
(Optional)

Specifies the default status of the 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 the one used when generating a diagram if a template is not specified. It is also the template used when using New Diagram on the Data tab on the utility network or trace network tab set if another template is not 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 your 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 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
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 default.

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

Boolean

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})
NameExplanationData 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.

  • 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 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.

  • 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 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.

  • 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 default.

  • REMOVE_LAYER_DEFINITIONSThe diagram layer definition related to the input diagram template will be reset to 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

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.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

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics