Insert total deformation result in modal analysis scoped to a named selection and define maximum and

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

How can I insert a total deformation result in a modal analysis scoped to a named selection and define maximum and frequency values as parameters?

Tagged:

Answers

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

    For example, you can use :

    solu=ExtAPI.DataModel.Project.Model.Analyses[0].Solution # reference solution
    
    res=solu.AddTotalDeformation() # add total deformation result
    
    res.Location=ExtAPI.DataModel.GetObjectsByName("base")[0]  # set location
    

    In the line above, we use "GetObjectsByName" method that returns a list of all the entitites of the Mechanical tree. Here we are searching for all objects named "base" and then using the first object in this list (hopefully, a named selection named “base”)

    As for specifying that the maximum and the frequency are parameters, one can use:

    res.CreateParameter("Maximum")
    
    res.CreateParameter('ActualFrequency') 
    
    ExtAPI.DataModel.Tree.Refresh()
    

    Be careful, there is also a property called “Frequency” that is invisible in the details view, with an internal value of 0 Hz. Please refer to bug 385482 for further details.