[S8373] 部品の色指定、グルーピングを行うスクリプト

パートの色指定、グルーピングを行うスクリプトを例示します。

app = designer.GetApplication()

# ツリーの上から1つ目のモデルに対し、部品を座標で選択し、色を変える

app.GetModel(0).GetPartByPosition(app.CreatePoint(35,5,0)).SetColor(u"blue")

# ツリーの上から1つ目のモデルに対し、部品を座標で選択し、名前を変える

app.GetModel(0).GetPartByPosition(app.CreatePoint(35,5,0)).SetName(u"Coil1")

# グループを作成

app.GetModel(0).GetGroupList().CreateGroup(u"Coil")

# グループに部品を追加

app.GetModel(0).GetGroupList().AddPartToGroup(u"Coil", u"Coil1")

app.GetModel(0).GetGroupList().AddPartToGroup(u"Coil", u"Coil2")

app.GetModel(0).GetGroupList().AddPartToGroup(u"Coil", u"Coil3")
ファイルご利用の注意点
JMAGスクリプトライブラリをご利用されるに際し、以下をよくお読みいただき、ご同意の上ご利用くださるようお願い申し上げます。
絞込み検索
  • カテゴリー 一覧

JMAG-Express Online
An engineer's diary