Align simulink blocks to top left of the window

4 views (last 30 days)
To try and keep or models neat and consistent we want to have all subsystems zoom set to 100% and aligned to the top left of the window when the model is opened. So I am trying to create an app that is run after the user makes changes to do this. I found this answer which helps with the zoom and in all except the top level they seem to happen to open with the blocks aligned to the top left of the window after changing the zoom. What command can I use to ensure that the blocks are located in the top left of the window and one that works at the top level of a model?
Thanks in advance for the help.

Answers (1)

Monika Jaskolka
Monika Jaskolka on 24 Nov 2021
As far as I am aware, the zooming function is not able to zoom to align blocks on the top left. The ZoomFactor parameter only has the below options, and FitSystem/FitSelection will both try to center the system/selection.
I am not aware of any other commands to move the viewbox in a more precise way.
To zoom only the top-level system, the command is:
set_param(bdroot(gcs), 'ZoomFactor', 'FitSystem')
Monika Jaskolka
Monika Jaskolka on 24 Nov 2021
No problem. Unfortunately it does seem like the functionality either doesn't exist or it exists but is "undocumented" by MathWorks.

Sign in to comment.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by