Mechanical ACT Custom Load for Macro Encapsulation: define step

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 741
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

I'm creating a custom load object through Mechanical ACT that encapsulates some APDL macro. This writes the APDL code to the ds.dat. How can I define at which step of a multistep analysis this macro gets written?

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 741
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

    The callback that inserts the APDL commands into the input deck should have an argument called SolverData. This argument contains the step number. You can do:
    if SolverData.CurrentStep==MyStep:
    stream.Writeline(allLines) # where allLines is your APDL macro.