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 until they are updated.
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.
When performing this operation on a utility network in an enterprise geodatabase, the connected ArcGIS Enterprise portal account must be the portal 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.
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
ImportDiagramTemplateDefinitions(in_utility_network, template_name, {ndbd_file}, {ndld_file})
Parameter | Explanation | Data 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
Name | Explanation | Data 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
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
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes