# Refine Layout

Use this action, like Auto Layout, to create a clean and uniform layout for the current subsystem or a selected subarea. However, unlike Auto Layout, the result is based on your current layout. This allows you to:

- define the structure of the layout (see Example 1),
- interactively optimize the result (see Examples 2 and 3),
- incrementally update the layout after subsystem modifications (see Example 4).

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:

You can define the structure of the layout by roughly placing the blocks and lines where you want them. The action then preserves this structure, unlike Auto Layout, and takes care of the remaining time-consuming tasks, such as aligning blocks and optimizing line routes.

Example 2:

You can interactively optimize the layout by manually adjusting the result and then restarting the action. Repeat these two steps until the layout meets your demands.

Example 3:

You can also optimize line routes interactively by manually adjusting the result and then restarting the action.

Example 4:

After you have continued to work on the subsystem manually, you can simply update the layout using the action. In contrast to Auto Layout, the structure of the old layout is preserved, so that small subsystem changes do not result in a completely different layout.

Example 5:

As with Auto Layout, 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.

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.