フィルターのクリア

How to programmatically control simulink block's "Send to Front"/"Send to Back" option?

16 ビュー (過去 30 日間)
Ankur
Ankur 2022 年 11 月 4 日
回答済み: Vignesh Murugavel 2022 年 11 月 8 日
How to programmatically control simulink block's "Send to Front"/"Send to Back" option?

回答 (1 件)

Vignesh Murugavel
Vignesh Murugavel 2022 年 11 月 8 日
In order to programmatically control Simulink block’s “Send to Front”/”Send to Back” option you should use the “ZOrder” Block Property.
The block property called "ZOrder" specifies a block's "depth" within the Simulink model (whether it appears on top or behind another block). Blocks with higher numbers will be drawn on top of blocks of lower numbers. You can access the "ZOrder" of the currently selected block by executing the following command in the MATLAB command window:
>>get_param(gcb,'ZOrder')
In a new model, the first block will have a "ZOrder" of 1, the next block will be 2, the third block will be 3, and so on.
Calling "Send to Back" sets a low and possibly negative value, calling "Bring to Front" sets a high and possibly positive value.
You can also programmatically set the ZOrder Property of the Block using:
>>set_param(gcb,'ZOrder', yourValue)

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by