フィルターのクリア

Get the Simulink block's handle of the block under the mouse

2 ビュー (過去 30 日間)
Gireg
Gireg 2011 年 3 月 25 日
Hi,
Does anyone know if it's possible to get the block's handle of the current block under the mouse (even if I don't select it by click)? I would like to create a drag'n drop interface with Simulink, so I need to know which Simulink block is under the mouse when user release the mouse. It seems "gcs" is not able to do it -> It need to click the block.
Thank you!

回答 (2 件)

MarkB
MarkB 2011 年 3 月 28 日
I don't believe that there is any way to detect a block that you are hovering over but haven't clicked. It is possible to detect the currently clicked block using "gcb". You can also find the currently selected block by executing "find_system( 'Type', 'Block', 'Selected', 'on' );", but this will return all selected blocks (parent systems of the currently selected block count as "selected" as well in this case).

Fangjun Jiang
Fangjun Jiang 2011 年 5 月 23 日
gcbh() is the command to get the block handle if the block is selected. You might want to refer to this post where I explained that it should be possible if certain API of Simulink is open to the user. But so far, no Mathworkers has answered my question.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by