We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.

Ansys Learning Forum Forums AIS Japan 構造 全てのボディに内容の異なるコマンドを設定したい Reply To: 全てのボディに内容の異なるコマンドを設定したい

yasuhiro.ogawa.j4a
Subscriber

Thank you for your response. Based on your comments, I was able to accomplish what I wanted to do. FYI, I am attaching the code.

# Creating the content to write in the command
mat_list = []
for i in range(1, 100):
    mat_list.append("mat{}".format(i))

# Creating the command and writing the contents
for num in range(1, 100):

    treeBody = Model.Geometry.Children[0].Children[num-1]  
    cs = treeBody.AddCommandSnippet()
    cs.AppendText(mat_list[num-1])