How to suppress multiple time-steps in a load object based on some logic?

Options
Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 419
5 Likes First Anniversary Ansys Employee Solution Developer Community of Practice Member
edited June 2023 in Structures

I want to suppress the step when displacement reaches zero or below -0.1. However, the example is just a simplified version of displacement input, the actual one is far more complicated.

Can I suppress certain time steps as one go, rather than doing individually and manually. Because it will too time consuming.

enter image description here

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 419
    5 Likes First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    Options

    One can use SetPropertyByStep function of the internal load object and build a logic around it. Example code below suppresses all the steps with YComponent values below zero:

    displacement = ExtAPI.DataModel.Tree.ActiveObjects[0]
    original_step_values = displacement.YComponent.Output.DiscreteValues
    for index, entry in enumerate(original_step_values, start=1):
        if entry.Value < 0.0:
            displacement.InternalObject.SetPropertyByStep(index, "Active", False)