Set Order of Execution for Python Objects in Mechanical

Mike.Thompson
Mike.Thompson Member, Employee Posts: 339
25 Answers 100 Comments 25 Likes First Anniversary
✭✭✭✭

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
    ✭✭✭

    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: 339
    25 Answers 100 Comments 25 Likes First Anniversary
    ✭✭✭✭

    @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
    ✭✭✭

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