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

조회 수: 1 (최근 30일)
BDI
BDI 2019년 2월 5일
편집: BDI 2023년 5월 17일
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

채택된 답변

BDI
BDI 2023년 5월 17일
편집: BDI 2023년 5월 17일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by