Export Diagram Content (Network Diagram)

Summary

Exports diagram content in a simple format (JSON) that reflects basic connectivity. Additional optional information such as diagram properties, diagram feature geometry, network elements attributes, and aggregated elements can also be exported.

Note:

The input network or diagram layer can be from a utility network or trace network in a file geodatabase, a utility network service, a trace network service, or a database connection to a utility network or trace network in an enterprise geodatabase.

Learn more about exporting diagram content

Usage

  • The exported .json file can be used for network calculation and analysis or to feed external systems.

    Learn more about the output JSON response syntax

  • When exporting diagram content with attributes, attributes with coded domain values can be exported as either raw values or string descriptions.

Parameters

LabelExplanationData Type
Input Network or Network Diagram Layer

The utility network or trace network layer, utility network or trace network data element, or network diagram layer related to the network diagram to export.

Utility Network; Trace Network; Utility Network Layer; Trace Network Layer; Diagram Layer
Network Diagram Name

The name of the network diagram to export.

String
Output File

The output .json file that will be created with the exported diagram content.

File
Include diagram properties
(Optional)

Specifies whether the diagram properties will be exported.

  • Checked—The diagram properties (statistics, creation and update dates, and so on) will be exported.
  • Unchecked—The diagram properties will not be exported. This is the default.

Boolean
Include geometries
(Optional)

Specifies whether the geometry of the diagram features will be exported.

  • Checked—Each diagram feature will be exported with its geometry.
  • Unchecked—Each diagram feature will be exported without its geometry. This is the default.

Boolean
Include attributes
(Optional)

Specifies whether the attributes of the associated network elements will be exported.

  • Checked—The associated network element attributes will be exported.
  • Unchecked—The associated network element attributes will not be exported. This is the default.

Boolean
Include aggregations
(Optional)

Specifies whether each diagram feature will be exported with a list of network elements it aggregates.

  • Checked—Each diagram feature will be exported with a list of network elements it aggregates with their asset group and asset type values.
  • Unchecked—The diagram feature aggregations will not be exported. This is the default.

Boolean
Use domain and subtype descriptions
(Optional)

Specifies how coded domain and subtype values will be exported. This parameter is enabled when the Include attributes or Include aggregations parameter is checked.

  • Checked—Coded domain and subtype values will be exported using their string descriptions rather than raw values.
  • Unchecked—Coded domain and subtype values will be exported as raw values. This is the default.
Boolean

arcpy.nd.ExportDiagramContent(in_utility_network, network_diagram_name, out_file, {include_diagram_properties}, {include_geometries}, {include_attributes}, {include_aggregations}, {use_domains})
NameExplanationData Type
in_utility_network

The utility network or trace network layer, utility network or trace network data element, or network diagram layer related to the network diagram to export.

Utility Network; Trace Network; Utility Network Layer; Trace Network Layer; Diagram Layer
network_diagram_name

The name of the network diagram to export.

String
out_file

The output .json file that will be created with the exported diagram content.

File
include_diagram_properties
(Optional)

Specifies whether the diagram properties will be exported.

  • INCLUDE_DIAGRAM_PROPERTIESThe diagram properties (statistics, creation and update dates, and so on) will be exported.
  • EXCLUDE_DIAGRAM_PROPERTIESThe diagram properties will not be exported. This is the default.
Boolean
include_geometries
(Optional)

Specifies whether the geometry of the diagram features will be exported.

  • INCLUDE_GEOMETRIESEach diagram feature will be exported with its geometry.
  • EXCLUDE_GEOMETRIESEach diagram feature will be exported without its geometry. This is the default.
Boolean
include_attributes
(Optional)

Specifies whether the attributes of the associated network elements will be exported.

  • INCLUDE_ATTRIBUTESThe associated network element attributes will be exported.
  • EXCLUDE_ATTRIBUTESThe associated network element attributes will not be exported. This is the default.
Boolean
include_aggregations
(Optional)

Specifies whether each diagram feature will be exported with a list of network elements it aggregates.

  • INCLUDE_AGGREGATIONSEach diagram feature will be exported with a list of network elements it aggregates with their asset group and asset type values.
  • EXCLUDE_AGGREGATIONSThe diagram feature aggregations will not be exported. This is the default.
Boolean
use_domains
(Optional)

Specifies how coded domain and subtype values will be exported. This parameter is enabled when the include_attributes parameter is set to INCLUDE_ATTRIBUTES or the include_aggregations parameter is set to INCLUDE_AGGREGATIONS.

  • USE_CODED_VALUE_NAMESCoded domain and subtype values will be exported using their string descriptions rather than raw values.
  • DONT_USE_CODED_VALUE_NAMESCoded domain and subtype values will be exported as raw values. This is the default.
Boolean

Code sample

ExportDiagramContent example (Python window)

Export Basic_RMT003 diagram content with the feature geometries, attributes with their string description for coded domain and subtype values, aggregations, and diagram properties.

import arcpy
arcpy.ExportDiagramContent_nd('elec Network', 'Basic_RMT003', 
                              'C:\temp\BasicRMT003.json', 
                              'INCLUDE_DIAGRAM_PROPERTIES', 'INCLUDE_GEOMETRIES', 
                              'INCLUDE_ATTRIBUTES', 'INCLUDE_AGGREGATIONS', 
                              'USE_CODED_VALUE_NAMES')

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics