Export Diagram Template Definitions (Network Diagram)

Summary

Exports the network diagram rule and layout definitions and the network diagram layer definition to .ndbd and .ndld files, respectively.

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.

  • The resulting .ndbd and .ndld files are useful for sharing diagram template definitions or copying diagram template definitions from one network to another.

Syntax

ExportDiagramTemplateDefinitions(in_utility_network, template_name, {out_ndbd_file}, {out_ndld_file})
ParameterExplanationData Type
in_utility_network

The utility network or trace network referencing the diagram template definitions to export.

Utility Network; Trace Network
template_name

The name of the diagram template with definitions to be exported.

String
out_ndbd_file
(Optional)

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

File
out_ndld_file
(Optional)

The network diagram layer definition file (.ndld) to be created.

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

ExportDiagramTemplateDefinitions example (Python window)

Export all the definitions set up on a particular diagram template in a given network and import those definitions into a diagram template in 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