Create Diagram Layer Definition (Network Diagram)

Summary

Creates a diagram layer definition for the input diagram template using the settings of the network feature layers in the active map.

This tool allows you to do the following:

  • Import the appearance and labeling settings configured on each feature layer in the active map when those layers are related to the utility network or trace network specified in the input.
  • Create a set of extra layers that may be relevant to the template, such as layers for system junctions, structural attachments, and so on.

Caution:

This tool is a configuration and administration tool.

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 or mobile 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 must be used in ArcGIS Pro, as it takes an input network layer referenced from an active map and prepares the network diagram composite layer for all diagrams that are based on the input template according to the layers in the input active map. After running with its default settings, each network diagram based on the input template displays the following:

    • One layer for each utility network or trace network layer representing network features in the active map specified as the input.
    • A set of extra layers that can be relevant or not to your template dedicated to the representation of the following types of network elements:
      • Connectivity associations and structural attachments represented as polylines in diagrams
      • Container polygon features, line features, and edge objects that can be transformed as points in diagrams
      • Container point features and container junction objects that can be transformed as polygons in diagrams
      • Junction objects represented as points in diagrams
      • Edge objects represented as polylines in diagrams
    • One layer, Reduction Edges, dedicated to the representation of aggregated network elements between two junctions.
    Note:

    The tool systematically discards layers present in the input map that are out of the utility network or trace network.

  • Depending on the Overwrite all layers parameter value, you can do the following:

    Then you can refine the diagram layer definition on a template.

  • When the Overwrite all layers parameter is unchecked, the existing defined layers will be preserved except those representing the same network sources as the input network map's layers. By default, those input layers will replace the existing layers unless the Merging With Existing Layer Definitions parameter value is Replace existing layers.

Parameters

LabelExplanationData Type
Input Network

The utility network or trace network layer in the active map.

Utility Network Layer; Trace Network Layer
Input Diagram Template

The name of the diagram template that will be modified.

String
System Junctions
(Optional)

Specifies whether system junctions and system junction objects will be represented in the diagrams based on the specified template.

  • Checked—The system junctions along the network lines and the system junction objects along the network edge objects will be represented in the diagrams by the System Junction layer and the System Junction Objects layer, respectively. This is the default.
  • Unchecked—System junctions and system junction objects will not be represented in the diagrams.

Boolean
Connectivity Associations
(Optional)

Specifies whether connectivity associations will be represented in the diagrams based on the specified template.

  • Checked—Connectivity associations will be represented in the diagrams by the Connectivity Associations layer. This is the default.
  • Unchecked— Connectivity associations will not be represented in the diagrams.

Boolean
Structural Attachments
(Optional)

Specifies whether structural attachment associations will be represented in the diagrams based on the specified template.

  • Checked—Structural attachment associations will be represented in the diagrams by the Structural Attachments layer. This is the default.
  • Unchecked—Structural attachment associations will not be represented in the diagrams.

Boolean
Reduction Edges
(Optional)

Specifies whether reduction edges will be represented in the diagrams based on the specified template.

  • Checked—Reduction edges will be represented in the diagrams by the Reduction Edges layer. This is the default.
  • Unchecked—Reduction edges will not be represented in the diagrams.

Boolean
Points for edges reduced as junctions or collapsed polygons
(Optional)

Specifies whether layers will be added to represent container polygon features, network line features, or network edge objects as point features in the diagrams.

The Subtype Layer column is used as follows:

  • Checked—The layer will be created with subtype group layers.
  • Unchecked—The layer will be created as a simple layer. This is the default.

Value Table
Polygons for containers
(Optional)

Specifies whether layers will be added to represent container point features or container junction objects as polygon features in the diagrams.

The Subtype Layer column is used as follows:

  • Checked—The layer will be created with subtype group layers.
  • Unchecked—The layer will be created as a simple layer. This is the default.

Value Table
Points for junction objects
(Optional)

Specifies whether layers will be added to represent junction objects as point features in the diagrams.

The Subtype Layer column is used as follows:

  • Checked—The layer will be created with subtype group layers.
  • Unchecked—The layer will be created as a simple layer. This is the default.

Value Table
Polylines for edge objects
(Optional)

Specifies whether layers will be added to represent edge objects as polyline features in the diagrams.

The Subtype Layer column is used as follows:

  • Checked—The layer will be created with subtype group layers.
  • Unchecked—The layer will be created as a simple layer. This is the default.

Value Table
Overwrite all layers
(Optional)

Specifies whether all existing layers under the diagram layer will be overwritten or preserved except those in the input network map and explicitly specified additional sublayers.

  • Checked—The diagram layer definition will be initialized or entirely reset (overwritten) including layers in the input map and specified additional sublayers. This is the default.
  • Unchecked—All existing layers under the diagram layer will be preserved except those in the input network map as well as additional sublayers explicitly specified.

Boolean
Merging With Existing Layer Definitions
(Optional)

Specifies how the input network map layers and existing diagram layers will be merged when the Overwrite all layers parameter is unchecked. This parameter applies to input network map layers related to network sources that are already present among the diagram layers. This parameter determines whether these input layers must replace the current diagram layers or be added to the existing diagram layers.

  • Replace existing layersThe input network map layers related to network sources already present among the diagram layers will replace the current diagram layers. This is the default.
  • Add new layersThe input network map layers related to network sources already present among the diagram layers will be added to the existing diagram layers.
String

Derived Output

LabelExplanationData Type
Output Network

The updated utility network or trace network layer.

Utility Network Layer; Trace Network Layer
Output Diagram Template

The name of the diagram template.

String

arcpy.nd.CreateDiagramLayerDefinition(in_utility_network, template_name, {system_junctions}, {connectivity_associations}, {structural_attachments}, {reduction_edges}, {point_subLayers}, {polygon_subLayers}, {junction_object_point_subLayers}, {edge_object_polyline_subLayers}, {overwrite_all_layers}, {merging_mode})
NameExplanationData Type
in_utility_network

The utility network or trace network layer in the active map.

Utility Network Layer; Trace Network Layer
template_name

The name of the diagram template that will be modified.

String
system_junctions
(Optional)

Specifies whether system junctions and system junction objects will be represented in the diagrams based on the specified template.

  • SHOWThe system junctions along the network lines and the system junction objects along the network edge objects will be represented in the diagrams by the System Junction layer and the System Junction Objects layer, respectively. This is the default.
  • HIDESystem junctions and system junction objects will not be represented in the diagrams.
Boolean
connectivity_associations
(Optional)

Specifies whether connectivity associations will be represented in the diagrams based on the specified template.

  • SHOWConnectivity associations will be represented in the diagrams by the Connectivity Associations layer. This is the default.
  • HIDEConnectivity associations will not be represented in the diagrams.
Boolean
structural_attachments
(Optional)

Specifies whether structural attachment associations will be represented in the diagrams based on the specified template.

  • SHOWStructural attachment associations will be represented in the diagrams by the Structural Attachments layer. This is the default.
  • HIDEStructural attachment associations will not be represented in the diagrams.
Boolean
reduction_edges
(Optional)

Specifies whether reduction edges will be represented in the diagrams based on the specified template.

  • SHOWReduction edges will be represented in the diagrams by the Reduction Edges layer. This is the default.
  • HIDEReduction edges will not be represented in the diagrams.
Boolean
point_subLayers
[[Name, Subtype Layer],...]
(Optional)

Specifies whether layers will be added to represent container polygon features, network line features, or network edge objects as point features in the diagrams.

The second column is used as follows:

  • True—The layer will be created with subtype group layers.
  • False—The layer will be created as a simple layer. This is the default.

Value Table
polygon_subLayers
[[Name, Subtype Layer],...]
(Optional)

Specifies whether layers will be added to represent container point features or container junction objects as polygon features in the diagrams.

The second column is used as follows:

  • True—The layer will be created with subtype group layers.
  • False—The layer will be created as a simple layer. This is the default.

Value Table
junction_object_point_subLayers
[[Name, Subtype Layer],...]
(Optional)

Specifies whether layers will be added to represent junction objects as point features in the diagrams.

The second column is used as follows:

  • True—The layer will be created with subtype group layers.
  • False—The layer will be created as a simple layer. This is the default.

Value Table
edge_object_polyline_subLayers
[[Name, Subtype Layer],...]
(Optional)

Specifies whether layers will be added to represent edge objects as polyline features in the diagrams.

The second column is used as follows:

  • True—The layer will be created with subtype group layers.
  • False—The layer will be created as a simple layer. This is the default.

Value Table
overwrite_all_layers
(Optional)

Specifies whether all existing layers under the diagram layer will be overwritten or preserved except those in the input network map and explicitly specified additional sublayers.

  • OVERWRITE_ALLThe diagram layer definition will be initialized or entirely reset (overwritten) including layers in the input map and specified additional sublayers. This is the default.
  • MERGEAll existing layers under the diagram layer will be preserved except those in the input network map as well as additional sublayers explicitly specified.
Boolean
merging_mode
(Optional)

Specifies how the input network map layers and existing diagram layers will be merged when the overwrite_all_layers parameter value is MERGE. This parameter applies to input network map layers related to network sources that are already present among the diagram layers. This parameter determines whether these input layers must replace the current diagram layers or be added to the existing diagram layers.

  • REPLACE_EXISTING_LAYERSThe input network map layers related to network sources already present among the diagram layers will replace the current diagram layers. This is the default.
  • ADD_NEW_LAYERSThe input network map layers related to network sources already present among the diagram layers will be added to the existing diagram layers.
String

Derived Output

NameExplanationData Type
out_utility_network

The updated utility network or trace network layer.

Utility Network Layer; Trace Network Layer
out_template_name

The name of the diagram template.

String

Code sample

CreateDiagramLayerDefinition example 1 (Python window)

Create a diagram layer definition on the template named MyTemplate1 related to the input network.

import arcpy
arcpy.nd.CreateDiagramLayerDefinition(input_Network, "MyTemplate1", 
                                      "SHOW", "SHOW", "HIDE", "HIDE", 
                                      "StructureBoundary true;StructureLine true;ElectricDistributionLine true", 
                                      "StructureJunction true;ElectricDistributionAssembly true",
                                      "ElectricDistributionJunctionObject true", 
                                      "ElectricDistributionEdgeObject true",
                                      "OVERWRITE_ALL")
CreateDiagramLayerDefinition example 2 (Python window)

Refine the diagram layer definition on the template named MyTemplate1 related to the input network by adding the Reduction Edges and Structural Attachments additional sublayers without changing the other diagram sublayers.

import arcpy
arcpy.nd.CreateDiagramLayerDefinition(input_Network, "MyTemplate1", 
                                      "HIDE", "HIDE", "SHOW", "SHOW", 
                                      overwrite_all_layers="MERGE")

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics