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

Member, Moderator, Employee Posts: 479
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

  • Member, Moderator, Employee Posts: 479
    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:

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

Welcome!

It looks like you're new here. Sign in or register to get started.