Make Diagram Layer (Network Diagram)

Summary

Creates a network diagram layer from a network diagram.

Usage

  • The output diagram layer can be used as input to any geoprocessing tool that accepts a diagram layer as input, including the Store Diagram, Update Diagram, and Apply Smart Tree Layout tools.

  • This tool must be executed in ModelBuilder or Python prior to any tool that requires a diagram layer.

Syntax

MakeDiagramLayer(in_utility_network, network_diagram_name, out_layer)
ParameterExplanationData Type
in_utility_network

The utility network or trace network the diagram is related to.

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

The network diagram name.

String
out_layer

The name of the diagram layer to be created.

The output diagram layer can be used as input to any geoprocessing tool that accepts a diagram layer as input, including the Store Diagram, Update Diagram, and Apply Smart Tree Layout tools.

Diagram Layer

Code sample

MakeDiagramLayer example (stand-alone script)

The following stand-alone script uses the MakeDiagramLayer tool to retrieve a stored network diagram in the database and execute the Smart Tree layout on it.

# Name: RetrieveAStoredDiagramAndApplyALayoutOnIt.py
# Description:  Retrieve a stored diagram and execute a layout on it.

# Import system modules
import arcpy

# Initialize variables
input_Network = "https://cezembre.esri.com/server/rest/services/Naperville2_Electric_SQL/FeatureServer/0"
input_DiagramName = "my1stdiagram"

# Set overwrite option
arcpy.env.overwriteOutput = True

# Retrieving a given stored diagram and transforming it as a diagram layer 
arcpy.MakeDiagramLayer_nd(input_Network, input_DiagramName, "built_diagramlayer")

# Applying the smart tree layout on this diagram 
arcpy.ApplySmartTreeLayout_nd("built_diagramlayer")

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics