How to create a nodal displacement on a named selection?

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

How to create a nodal displacement on a named selection?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 823
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    edited June 12
    Options

    Adapt the following code:

    analysis = ExtAPI.DataModel.Project.Model.Analyses[0]
    nodal_disp = analysis.AddNodalDisplacement() # Add BC
    nodal_disp.Location = ExtAPI.DataModel.GetObjectsByName('Nodal_NS')[0] 
    # Note: GetObjectsByName method returns a list of all tree elements with a specific name.
    # If the name is unique, it is a convenient method to grab tree objects
    # Define X values through tabular data
    nodal_disp.XComponent.Inputs[0].DiscreteValues  =[Quantity('0.5[s]'), Quantity('1[s]')]
    nodal_disp.XComponent.Output.DiscreteValues  =[Quantity('0[mm]'), Quantity('1[mm]')]
    # Define Y values through tabular data
    nodal_disp.YComponent.Inputs[0].DiscreteValues  =[Quantity('0.5[s]'), Quantity('1[s]')]
    nodal_disp.YComponent.Output.DiscreteValues  =[Quantity('0[mm]'), Quantity('0[mm]')]
    # Define Z values through tabular data
    nodal_disp.ZComponent.Inputs[0].DiscreteValues  =[Quantity('0.5[s]'), Quantity('1[s]')]
    nodal_disp.ZComponent.Output.DiscreteValues  =[Quantity('0[mm]'), Quantity('2[mm]')]