Bolt Script Examples#

Download the ExampleModel.fez for this example.

Code Snippet: Manipulation of Bolt Properties#
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect

current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None))) 

RS2Modeler.startApplication(port=60054)
modeler = RS2Modeler(port=60054)
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")

boltList = model.getAllBoltProperties()
bolt1 = boltList[0]
bolt2 = boltList[1]
bolt3 = boltList[2]

bolt1.setBoltName("Example Bolt 1")
bolt1.setBoltType(BoltTypes.FULLY_BONDED)
bolt1.FullyBonded.setBoltDiameter(28)
bolt1.FullyBonded.setJointShear(True)
bolt1.FullyBonded.setPreTensioningForce(0.2)

print(bolt1.FullyBonded.getBoltDiameter())
print(bolt1.FullyBonded.getJointShear())
print(bolt1.FullyBonded.getPreTensioningForce())

bolt2.setBoltName("Example Bolt 2")
bolt2.setBoltType(BoltTypes.END_ANCHORED)
bolt2.EndAnchored.setProperties(BoltModulusE=250000, OutofPlaneSpacing=1.2, TensileCapacity=0.2)

print(bolt2.EndAnchored.getProperties())

bolt3.setBoltName("Example Bolt 3")
bolt3.setBoltType(BoltTypes.PLAIN_STRAND_CABLE)
bolt3.PlainStrandCable.setProperties(AddBulges=True, AddPullOutForce=True, PullOutForce=1)
# Not all functions are accessible through the setProperties method. 
# Consult setProperties method definition in documentation to determine properties available.
bolt3.PlainStrandCable.setBulgeLocations([10,20,30])

print(bolt3.PlainStrandCable.getProperties())
# Not all functions are accessible through the getProperties method. 
# Consult getProperties method definition in documentation to determine properties available.
print(bolt3.PlainStrandCable.getBulgeLocations())

model.close()
modeler.closeProgram()

Output#

28.0
True
0.2
{'BoltDiameter': 19.0, 'BoltModulusE': 250000.0, 'TensileCapacity': 0.2, 'ResidualTensileCapacity': 0.0, 'OutofPlaneSpacing': 1.2, 'PreTensioningForce': 0.0, 'ConstantPretensioningForceInInstallStage': True}
{'BoreholeDiameter': 48.0, 'CableDiameter': 19.0, 'CableModulusE': 200000.0, 'CablePeak': 0.1, 'OutofPlaneSpacing': 1.0, 'WaterCementRatio': 0.35, 'JointShear': True, 'FacePlates': True, 'AddPullOutForce': True, 'PullOutForce': 1.0, 'ConstantShearStiffness': False, 'Stiffness': 100.0, 'AddBulges': True, 'BulgeType': <BulgeTypes.GARFORD_BULB_25MM: 'PHASE2_BULGE_GARFORD_25'>}
[10.0, 20.0, 30.0]