Skip to end of metadata
Go to start of metadata

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.

view = selection[1];
view.setTaggedValue("fullLayoutDirection", "LR");


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.

Steps:

  1. Open the view you want to perform the automatic layout on.

  2. Select the view in the model browser. Make sure the view stays selected.

  3. Open the Query tool (Ctrl+Q) and paste the script.

  4. 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.

  5. 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.