When performing the automatic layout on an ArchiMate view, the applied direction of the layout is always top to bottom.
If you want to apply a different direction to the layout, you can configure it using the following script.
The last section of the script is the variable value for the layout direction. Allowed values are:
- TB : Top to bottom (default value)
- LR: Left to right
- RL: Right to left
- BT: Bottom to top
Example of automatic layout performed with right to left direction
Using a different layout direction only applies to performing the hierarchical layout, the default layout type. It does not apply to the spring layout.
Open the view you want to perform the automatic layout on.
- Select the view in the model browser. Make sure the view stays selected.
- Open the Query tool (Ctrl+Q) and paste the script.
- Set the desired direction in the script and click Execute (You can leave the output type).
If the script results in an error saying that the method is only available on objects, it means that the view has not been actively selected. Select the view again in the model browser and execute the script one more time.
- Click in the open view, and then click Automatic Layout in the Home ribbon tab, or press F6 to perform the automatic layout on the view.
Please take note that if you want to change direction in the script and perform the automatic layout again, always make sure that the view is selected in the model browser before you execute the adjusted script.
If you save the script in your model to reuse it again another time, also make sure that when you want to use it again, the view is selected before you run the script and perform the automatic layout.