Add Diagram Template (Network Diagram)

Summary

Adds a new diagram template to a network. Both a network diagram rule and layout definitions file (.ndbd) and a network diagram layer definition file (.ndld) can be imported.

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

  • Adding a new diagram template to a specified input network will create a template with no particular settings.

  • When the tool executes with either no .ndld file or an empty .ndld file in input, the tool process automatically initializes a default diagram layer definition on the newly created template.

Syntax

arcpy.nd.AddDiagramTemplate(in_utility_network, template_name, {ndbd_file}, {ndld_file})
ParameterExplanationData Type
in_utility_network

The utility network or trace network to which the template will be added.

Utility Network; Trace Network
template_name

The name of the output diagram template.

String
ndbd_file
(Optional)

The network diagram rule and layout definitions file (.ndbd) to import. This file can be created using the Export Diagram Template Definitions tool on an existing template.

File
ndld_file
(Optional)

The diagram layer definition file (.ndld) to import. This file can be created using the Export Diagram Template Definitions or Export Diagram Layer Definition tool on an existing template.

When this parameter is not specified or loads an empty .ndld file, a default diagram layer definition is systematically initialized on the input diagram template.

File

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

AddDiagramTemplate example (Python window)

Add a new diagram template called MyTemplate1 to a given network.

import arcpy
input_Network = "D:/MyProjectLocation/MyDatabaseConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DiagramTemplate = "MyTemplate1"
arcpy.AddDiagramTemplate_nd(input_Network, input_DiagramTemplate)

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics