Bolt Pretension by Named Selection

Drago
Drago Member, Employee Posts: 18
First Anniversary Ansys Employee First Comment Photogenic
edited July 2023 in Structures

After creating a Bolt Pretension with:

newBoltPretension = Model.Analyses[0].AddBoltPretension()

I am wondering how to change the scoping to a Named Selection and how to assign a value. Thank you

Tagged:

Answers

  • Drago
    Drago Member, Employee Posts: 18
    First Anniversary Ansys Employee First Comment Photogenic
    edited July 2023 Answer ✓

    Assuming the NS is ‘Bolt 1‘, with the following it can be assigned to the selection:

    Pretension = Model.Analyses[0].AddBoltPretension()
    
    BoltObj = DataModel.GetObjectsByName(selection)[0]
    
    Pretension.Location = Obj
    

    Assuming that the force to be applied is 1000 N, it can be applied with:

    Pretension.SetDefineBy(1,BoltLoadDefineBy.Load)
    
    Pretension.Preload.Output.SetDiscreteValue(0,Quantity("1000[N]"))
    

    The solution was taken from KM #2056373

  • M
    M Member, Employee Posts: 199
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    # Get Beam objects
    myObj = 'Connections'
    myBeamsIDs = []
    myLoads = [1,2,3,4]
    
    model = ExtAPI.DataModel.Project.Model
    obj = ExtAPI.DataModel.GetObjectsByName(myObj)[0]
    for beam in obj.Children:
        if 'Beam' in beam.GetType().ToString():
            myBeamsIDs.append(beam.ObjectId)
    
    
    # Create Bolt Pretension for each Beam
    ctr = 0
    for beam in myBeamsIDs:
        boltPreTens = model.Analyses[0].AddBoltPretension()
        boltPreTens.InternalObject.GeometryDefineBy = 19  # secret sauce
        boltPreTens.InternalObject.BeamConnectionSelection = beam
        load = Quantity(myLoads[ctr],'N')
        #boltPreTens.Formulation = FormulationType.SmallRotation
        boltPreTens.Preload.Output.Field.Output.SetDiscreteValue(1,load)
        ctr +=1