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

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 454
100 Answers 250 Likes 100 Comments Second Anniversary
✭✭✭✭
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: 454
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
    Answer ✓

    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)