How to define a parameter from a Solution Combination in Mechanical

Javier Vique
Javier Vique Member, Employee Posts: 86
Second Anniversary 5 Answers 25 Likes 10 Comments
✭✭✭✭
edited June 2023 in Structures

Solution Combination does not allow to define results values as output parameters. However, it does not mean that we cannot define these output values as parameters for a parametric study.

The idea would be using a Python Code object in the upstream simulation which forces Solution Combination to be evaluated and then take the value that user is interested in.

Here the code used in Python Code:

SolutionCombination = ExtAPI.DataModel.GetObjectsByType(DataModelObjectCategory.SolutionCombination)[0]
SolutionCombination.EvaluateAllResults()
StressValue = SolutionCombination.Children[0]
this.GetCustomPropertyByPath("Parameters Solution Combination/Maximum SEQV").Value = StressValue.Maximum.Value

(Be aware that we need to activate an output parameter in Property Provider).

Tagged:

Comments

  • James Derrick
    James Derrick Administrator, Employee Posts: 283
    Ancient Membership 100 Comments 100 Likes 25 Answers
    admin

    hi @Javier Vique I've added a codeblock to your post text, but I was wondering what the this object is? Where does it come from? This could be an ACT thing I'm not aware of.

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    edited December 2022

    hi @James Derrick . this is a helper argument of the function that is called in the callback of the Python Code object, and refers to the datamodel object instance of the python code object you are currently editing in the tree. Indeed, this is specific to Mechanical scripting.