Import Diagram Template Definitions (Network Diagram)

Summary

Imports a network diagram rule and layout definitions file (.ndbd), a network diagram layer definition file (.ndld), or both into an existing template.

Caution:

This tool is a configuration and administration tool.

Note:

Importing a network diagram rule and layout definitions file (.ndbd) 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 stay inconsistent and open with a consistency warning icon May be inconsistent 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:

  • This tool is useful for copying the full diagram template definitions from one network to another.

  • The input diagram template must be from the same type of network as the network diagram rule and layout definitions file (.ndbd) and network diagram layer definition file (.ndld)—for example, you can't import network diagram rule and layout definitions file nor network diagram layer definition file from a gas utility network into a template related to a water or electric utility network. In general, do not export definitions from a source template and import them to a destination template when the networks of the source and destination templates don't share the following:

    • The same network type
    • The same domain
    • The same data model
    • The same asset type and asset group values

  • The diagram template must already exist for the input network before using this tool. Its network diagram rule and layout definitions and diagram layer definition will be entirely overwritten by the imported definitions at the end of the tool execution.

  • When a diagram layer definition does not exist on the input diagram template and 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 template.

Syntax

arcpy.nd.ImportDiagramTemplateDefinitions(in_utility_network, template_name, {ndbd_file}, {ndld_file})
ParameterExplanationData 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 onto which the definitions will be imported.

String
ndbd_file
(Optional)

The network diagram rule and layout definitions file (.ndbd) to import.

This file is the result of the execution of the Export Diagram Template Definitions tool on an existing template.

At least one of the two input file parameters must be completed; that is, either the network diagram rule and layout definitions file (.ndbd) or the network diagram layer definition file (.ndld) must be completed.

File
ndld_file
(Optional)

The network diagram layer definition file (.ndld) to import.

This file is the result of the execution of the Export Diagram Template Definitions or Export Diagram Layer Definition geoprocessing tool on an existing template.

At least one of the two input file parameters must be completed; that is, either the network diagram rule and layout definitions file (.ndbd) or the network diagram layer definition file (.ndld) must be completed.

When a diagram layer definition does not yet exist for the input diagram template and this parameter is not specified or loads an empty .ndld file, a default diagram layer definition is systematically initialized on the 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

ImportDiagramTemplateDefinitions example (Python window)

Export all the definitions set up on a particular diagram template under a given network and import those definitions into a diagram template on another network.

import arcpy
import os

input_SourceNetwork = "D:/MyProjectLocation/MyDatabaseSourceConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
input_DestinationNetwork = "D:/MyProjectLocation/MyDatabaseDestinationConnection.sde/MyDatabase.MAP.Electric/MyDatabase.MAP.Electric"
folder = "D:/MyProjectLocation/"
input_SourceTemplate = "SourceTemplate"
input_DestinationTemplate = "DestinationTemplate"

arcpy.ExportDiagramTemplateDefinitions_nd(input_SourceNetwork, 
                                          input_SourceTemplate, 
                                          os.path.join(folder, "DiagramRuleAndLayoutDefinitions.ndbd"), 
                                          os.path.join(folder, "DiagramLayerDefinition.ndld"))
arcpy.ImportDiagramTemplateDefinitions_nd(input_DestinationNetwork, 
                                          input_DestinationTemplate, 
                                          os.path.join(folder, "DiagramRuleAndLayoutDefinitions.ndbd"),
                                          os.path.join(folder, "DiagramLayerDefinition.ndld"))

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics