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 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:
- The Input Network parameter value must be from a database connection established as the database utility network owner or database trace network owner.
- The connected ArcGIS Enterprise portal account must be the portal utility network owner or portal trace network owner.
- This tool must be connected to the default version, which is expected to be public and not protected.
The resulting .ndbd and .ndld files are useful for sharing diagram template definitions or copying diagram template definitions from one network to another.
Syntax
arcpy.nd.ExportDiagramTemplateDefinitions(in_utility_network, template_name, {out_ndbd_file}, {out_ndld_file})
Parameter | Explanation | Data 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
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 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
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes