Is it possible to access the details view, and especially read/edit the “ARG1”, “ARG2”, etc. values of a command snippet in Mechanical?
Yes, this is possible:
analysis = ExtAPI.DataModel.Project.Model.Analyses[0] # reference analysis snippet = analysis.GetChildren(DataModelObjectCategory.CommandSnippet,True)[0] # get first command snippet object in the analysis print(snippet.InputArgument1) # print the value of “ARG1” snippet.InputArgument1="342" # change the value of “ARG1”
OutputParameter_1 = snippet.OutputParameters[0].Value