フィルターのクリア

How to get all the selected objects in a stateflow diagram?

4 ビュー (過去 30 日間)
John Karter
John Karter 2020 年 6 月 30 日
コメント済み: John Karter 2020 年 6 月 30 日
I am trying to run some code in a Stateflow model when its objects are selected. How do I find which objects have been selected??
Thanks in advance!

回答 (1 件)

Gaganjyoti Baishya
Gaganjyoti Baishya 2020 年 6 月 30 日
Hi, please try this code snippet. It worked for my use-case.
rt = sfroot;
m = rt.find('-isa', 'Stateflow.Machine', '-and','Name',bdroot);
visChart = m(1).find('Visible',1); % find stateflow chart handle
editor = visChart.Editor; % Editor object of the current
curObj = editor.selectedObjects;
curObj stores all the SF objects that are selected.
  1 件のコメント
John Karter
John Karter 2020 年 6 月 30 日
Thanks. It worked perfectly :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by