Skip To Content

Apply Grid Layout


Positions diagram junctions relative to a predefined magnetic grid.


If you have an open edit session, you must save your edits prior to running this tool. This ensures 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.


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 is used instead.


  • This 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 essentially 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 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 to increase the grid cell size.


ApplyGridLayout_un (in_network_diagram_layer, {are_containers_preserved}, {cell_width_absolute}, {cell_height_absolute})
ParameterExplanationData Type

The network diagram where the layout will be applied.

Diagram Layer

Specifies how containers will be processed by the algorithm.

  • PRESERVE_CONTAINERS The layout algorithm executes on the top graph of the diagram so containers are preserved.
  • IGNORE_CONTAINERSThe layout algorithm executes on both content and noncontent features in the diagram. This is the default.

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

Linear Unit

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

Linear Unit

Derived Output

NameExplanationData Type

The updated network diagram layer.

Diagram Layer

Code sample

ApplyGridLayout example (Python window)

Apply the Grid Layout algorithm to the Temporary Diagram diagram.

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


This tool does not use any geoprocessing environments.

Licensing information

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

Related topics