How can I set the default view when I open a bloc in Simulink

1 visualización (últimos 30 días)
BDI
BDI el 5 de Feb. de 2019
Editada: BDI el 17 de Mayo de 2023
Hello,
I recently upgraded to Simulink 2016b. When I open a bloc in Simulink, the view is occasionnaly way off, and I need to press space to fit the view.
I've tried to save the model when the view is fitted, close it and reopen it, with no succes.
Can I set the default view when I open a bloc to be fitted?
Thanks

Respuesta aceptada

BDI
BDI el 17 de Mayo de 2023
Editada: BDI el 17 de Mayo de 2023
The solution I've found (years ago) is to use the model callback PostLoadFcn and to fit the view programmatically every time the model is open with this script :
top = gcb;
while(get_param(top, 'Parent')~=0) %or split
top = get_param(top, 'Parent');
end
all_Subsystem = find_system(top, 'FollowLinks', 'on','BlockType','SubSystem');
for i=1:numel(all_Subsystem)
set_param(all_Subsystem{i},'Zoomfactor','fit to view')
end

Más respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by