How to create load objects in WB LS-DYNA?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 442
250 Likes Solution Developer Community of Practice Member Ansys Employee First Anniversary
✭✭✭✭
edited June 2023 in Structures

How to create load objects in WB LS-DYNA?

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 442
    250 Likes Solution Developer Community of Practice Member Ansys Employee First Anniversary
    ✭✭✭✭
    Answer ✓

    Since WB LS-DYNA is itself an ACT extension. The load-objects are ACT load-objects and not native Mechanical. Therefore, one needs to use CreateLoadObject

    Eg:

    analysis = ExtAPI.DataModel.AnalysisList[0]  # Get the analysis object
    analysis.CreateLoadObject("Section", "LSDYNA")
    analysis.CreateLoadObject("Hourglass", "LSDYNA")
    analysis.CreateLoadObject("ContactProperty", "LSDYNA")
    

    Properties:

    section = analysis.CreateLoadObject("Section", "LSDYNA")
    selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
    selection.Ids = [16]
    section.Properties['Geometry/DefineBy/Geo'].Value = selection
    
  • Aria
    Aria Member, Employee Posts: 67
    Ansys Employee Photogenic First Anniversary 25 Answers
    ✭✭✭✭
    Answer ✓

    To add on the previous response, in order to add an LS-Dyna load object, the correct header has to be activated. For the examples in Ayush's snippet, analysis.Activate() needs to be added:

    # 
    analysis = ExtAPI.DataModel.AnalysisList[0]  # Get the analysis object
    analysis.Activate()
    analysis.CreateLoadObject("Section", "LSDYNA")
    analysis.CreateLoadObject("Hourglass", "LSDYNA")
    analysis.CreateLoadObject("ContactProperty", "LSDYNA")
    

    In these cases, these load objects are found under the analysis list. For object such as rigid bodies, it is found under DataModel:

    expRB = ExtAPI.DataModel.CreateObject("ExplicitRigidBodies",'LSDYNA')