How can I create a user-defined result through scripting?

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 715
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
edited June 2023 in Structures

How can I create a user-defined result through scripting?

Tagged:

Answers

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

    Below is an example:

        # store link to solution
        solu=ExtAPI.DataModel.Project.Model.Analyses[0].Solution
        # add UDR
        newUDR = solu.AddUserDefinedResult() 
        # define expression
        newUDR.Expression="UX" 
        # change display time
        newUDR.DisplayTime = Quantity('1 [sec]')
        # evaluate
        newUDR.EvaluateAllResults()