Apply Grid Layout (Network Diagram)

Summary

Positions diagram junctions relative to a predefined magnetic grid.

Learn more about the Grid layout algorithm

Caution:

If you have an open edit session, you must save your edits prior to running this tool. This ensures that the diagram reflects the latest changes made to the network topology in the database. If you fail to save your edits, the edits will not be reflected in the diagram.

Note:

Each layout algorithm includes default parameter values. The default parameter values will be used unless otherwise specified. If the input network diagram is based on a template for which this layout has been configured with a different parameter value, that value will be used instead.

Usage

  • This tool is not supported when working with a database connection to a utility network or trace network in an enterprise geodatabase. You must use either the related published utility network or trace network service, or a utility network or trace network in a file or mobile geodatabase.

  • The input network diagram layer must be from either a utility network or a trace network in a file or mobile geodatabase. or a network diagram service.

  • This layout algorithm positions diagram junctions relative to a magnetic grid that has cell sizes fixed by the Cell Width and Cell Height parameter values.

  • A grid with a specified cell size is placed on the top of the diagram. The algorithm controls the number of cells that comprise a grid. This is calculated by factoring in the number of junctions that are going to be placed in the grid and the number of junctions that belong to each cell in the virtual grid.

  • When there are too many junctions in one or several virtual grid cells, the algorithm cannot complete the process and a warning appears advising you to decrease the grid cell size.

  • When the specified grid is composed of a large number of cells relative to the number of junctions to be placed in the grid, a warning appears advising you to increase the grid cell size.

  • Consider applying the layout in asynchronous mode on the server when working on very large diagrams.

Parameters

LabelExplanationData Type
Input Network Diagram Layer

The network diagram to which the layout will be applied.

Diagram Layer
Preserve container layout
(Optional)

Specifies how the algorithm will process containers.

  • Checked—The layout algorithm will apply to the top graph of the diagram so containers are preserved.
  • Unchecked—The layout algorithm will apply to both content and noncontent features in the diagram. This is the default.

Boolean
Cell Width
(Optional)

The width of each grid cell. The default is 2 in the units of the diagram's coordinate system.

Linear Unit
Cell Height
(Optional)

The height of each grid cell. The default is 2 in the units of the diagram's coordinate system.

Linear Unit
Run in asynchronous mode on the server
(Optional)

Specifies whether the layout algorithm will run asynchronously or synchronously on the server.

  • Checked—The layout algorithm will run asynchronously on the server. This option dedicates server resources to run the layout algorithm with a longer time-out. Running asynchronously is recommended for layouts that are time consuming and may exceed the server time-out (for example, Partial Overlapping Edges) and applying to large diagrams (more than 25,000 features).
  • Unchecked—The layout algorithm will run synchronously on the server. It can fail without completion if it exceeds the service default time-out value of 600 seconds. This is the default.

Boolean

Derived Output

LabelExplanationData Type
Output Network Diagram

The updated network diagram layer.

Diagram Layer

arcpy.nd.ApplyGridLayout(in_network_diagram_layer, {are_containers_preserved}, {cell_width_absolute}, {cell_height_absolute}, {run_async})
NameExplanationData Type
in_network_diagram_layer

The network diagram to which the layout will be applied.

Diagram Layer
are_containers_preserved
(Optional)

Specifies how the algorithm will process containers.

  • PRESERVE_CONTAINERS The layout algorithm will apply to the top graph of the diagram so containers are preserved.
  • IGNORE_CONTAINERSThe layout algorithm will apply to both content and noncontent features in the diagram. This is the default.
Boolean
cell_width_absolute
(Optional)

The width of each grid cell. The default is 2 in the units of the diagram's coordinate system.

Linear Unit
cell_height_absolute
(Optional)

The height of each grid cell. The default is 2 in the units of the diagram's coordinate system.

Linear Unit
run_async
(Optional)

Specifies whether the layout algorithm will run asynchronously or synchronously on the server.

  • RUN_ASYNCHRONOUSLYThe layout algorithm will run asynchronously on the server. This option dedicates server resources to run the layout algorithm with a longer time-out. Running asynchronously is recommended for layouts that are time consuming and may exceed the server time-out (for example, Partial Overlapping Edges) and applying to large diagrams (more than 25,000 features).
  • RUN_SYNCHRONOUSLYThe layout algorithm will run synchronously on the server. It can fail without completion if it exceeds the service default time-out value of 600 seconds. This is the default.
Boolean

Derived Output

NameExplanationData Type
out_network_diagram_layer

The updated network diagram layer.

Diagram Layer

Code sample

ApplyGridLayout example (Python window)

Apply the Grid Layout algorithm to the diagram called Temporary Diagram.

import arcpy
arcpy.ApplyGridLayout_nd("Temporary Diagram", "PRESERVE_CONTAINERS", "2 Feet", 
                         "5 Feet", "RUN_SYNCHRONOUSLY")

Environments

This tool does not use any geoprocessing environments.

Licensing information

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

Related topics