# Auto Layout

This action automatically arranges the blocks and routes the signal lines in the current subsystem, for a clean and uniform layout. You can lay out the entire subsystem or only a selected subarea.

You can use the action demo model as part of the MoRe demo model to try out the action and learn how to use it.

Example 1:

Automatically lay out an entire medium-sized subsystem.

Example 2:

Automatically lay out only the selected subarea. Selected blocks are positioned only with respect to each other, i.e they are not aligned with unselected blocks.

Example 3:

You can also set custom parameters for blocks and lines with the action. For example, you can color port blocks and enable signal propagation for lines. Simply activate the feature via "Preferences -> Config File" and set "ApplyMoRePreferencesToBlocksAndLines" to true.

Usage:

Open the subsystem you want to lay out and then select the action. If you want to lay out only a part of the subsystem, hold down the mouse button, draw the selection rectangle in the Simulink editor, then select the action.

In some cases, you may not want blocks without ports to be repositioned when applying the "Auto Layout" action. You can use a configuration parameter to exclude blocks like Doc blocks or TL reference blocks from the action. Simply activate the feature via "Preferences -> Config File" and set "IncludeBlocksWithoutPorts" to false.

The action adjusts some block heights to reduce line bends, e.g. for a bus selector connected to a subsystem. You can disable this height optimization via "Preferences -> Config File" by setting "OptimizeBlockHeights" to false.