Set Order of Execution for Python Objects in Mechanical

Options
Mike.Thompson
Mike.Thompson Member, Employee Posts: 312
First Anniversary First Comment 5 Likes Ansys Employee

Is there a way to set the order in which Python Code/Results objects are executed? For example if After Solve I want to run multiple Python objects, but want them to run in particular order, can this be specified somehow?

Tagged:

Answers

  • amasih
    amasih Member, Employee Posts: 2
    Name Dropper First Comment
    Options

    This is not a documented feature, but the order you connect the Python Code objects is the order they will execute in.

    Python Code AfterSolve 1 - Connect this first
    Python Code AfterSolve 2 - Connect this second

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 312
    First Anniversary First Comment 5 Likes Ansys Employee
    Options

    @amasih , Is there a property of the objects that tells when it was connected, or gives access to the index it is in the list of connected objects?

  • amasih
    amasih Member, Employee Posts: 2
    Name Dropper First Comment
    Options

    @Mike.Thompson No, unfortunately there's no way to know that.