Bolt Pretension by Named Selection
Drago
Member, Employee Posts: 17
✭✭✭
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:
0
Answers
-
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
0 -
# 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
0