How to define a parameter from a Solution Combination in Mechanical
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).
Comments
-
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.1 -
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.0