ブロックの背景色一括変更

조회 수: 16 (최근 30일)
Yuma Yamazaki
Yuma Yamazaki 2020년 2월 21일
편집: stozaki 2020년 2월 21일
モデル全体に対して、該当ブロックタイプの背景色を一括で変更することは可能でしょうか?
<例>
全てのGotoブロックの背景色を緑にする。

채택된 답변

stozaki
stozaki 2020년 2월 21일
편집: stozaki 2020년 2월 21일
Yamazaki様
以下の様なプログラムは如何でしょうか?
ret = find_system(bdroot(gcs),'BlockType','Goto'); % モデル内からGotoブロックをリストする
for N = 1:length(ret)
set_param(ret{N},'BackgroundColor','green'); % 取得リストのBackgroundColorの値をgreenに設定する
end
find_system : システム、ブロック、ライン、端子、注釈の検索
set_param : システムとブロックのパラメーター値の設定
  댓글 수: 1
Yuma Yamazaki
Yuma Yamazaki 2020년 2월 21일
Stozaki様
ご回答有難うございます。
ご教授頂いたコードで問題無く、やりたい処理の実行がされました。
大変助かりました。
以上、宜しくお願い致します。
Yamazaki

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Create Large-Scale Model Components에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!