필터 지우기
필터 지우기

Undo possible for programmatically changed simulink model?

조회 수: 2 (최근 30일)
Raphael Klapczynski
Raphael Klapczynski 2018년 2월 21일
답변: Raphael Klapczynski 2018년 3월 5일
I've created some little helper-functions which help me e.g. to automatically create in- and outports for Subsystems or automatically reposition those ports. I'm using the add_block, add_line, set_param functions for this.
Is there any way to be able to undo those changes in Simulink if necessary?
Thanks in advance.

답변 (2개)

Sujit Muduli
Sujit Muduli 2018년 3월 5일
Hi Raphael,
There is no API call available to do the UNDO operation.
But you may implement your custom UNDO function by keeping the handles for each of the blocks and lines that you are creating by your scripts.
Just wondering about your use case and where you are thinking of using this UNDO call could you please let me know about your workflow?

Raphael Klapczynski
Raphael Klapczynski 2018년 3월 5일
Hi Sujit, I use simple functions to e.g. automatically generate necessary inport and outport blocks for the selected Subsystem, reposition/reorder the child blocks of the selected Subsystem (to tidy up the model), etc...
There is always the possibility that you're doing something wrong and want to UNDO it. If I would implement a custom UNDO function it should work the same (usability)(same Buttons, same Hotkey-Buttons) as the original UNDO function which I don't know how to implement without collide with the original UNDO function (e.g. start an UNDO-step for my script without activating the original UNDO-function and vice versa). There needs to be an "observer" which decides if the next UNDO step is from my function or from the Simulink-UNDO. Don't know if that is possible.
Thanks in advance for your help.

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by