Support Control Script Examples#

Download the blankSupportModel.rs3v3 for this example.

from rs3.RS3Modeler import RS3Modeler
import os
import shutil
from rs3.CommonEnums import SupportTypes
from rs3.Geometry import *

Get the current folder directory.

current_dir = os.path.dirname(os.path.abspath(""))

Specify a port number that is not in use and start the RS3 program.

port = 60111
RS3Modeler.startApplication(port)
2026-09-16 16:49:04,158 - Rocscience.RS3 - INFO - Attempting to start the application at C:\Program Files\Rocscience\RS3\RS3 and binding server to port 60111...

Connect with the RS3 Modeler.

modeler = RS3Modeler(port)

For the demonstration purposes only, the model is copied for reuse. You may change the model path to your own model path.

blankModelPath = rf"{current_dir}\example_models\blankSupportModel.rs3v3"
copiedModelPath = rf"{current_dir}\example_models\copiedSupportModel.rs3v3"
_ = shutil.copy(blankModelPath, copiedModelPath)

Open the copied model file.

model = modeler.openFile(copiedModelPath)

1. Beam Control#

1.1 Select Beam Entity#

Select beams in the model by defining a region and by name.

cylinderRegion = Cylinder(Point(10, -1, -10), Point(10, 1, -10), 2)
beam_0 = model.Selection.getSupportEntities(SupportTypes.BEAM, cylinderRegion, includeIntersecting=False)[0]
beam_10 = model.Entity.getSupportEntityByName(SupportTypes.BEAM, "Beam 2")

1.2 Rename Beam Entity#

Rename both beams.

beam_0.setName("Beam at Y=0")
beam_10.setName("Beam at Y=10")

1.3 Set Beam Property to Beam Entity#

Create a new beam.

newBeamName = "New Beam"
model.createNewBeamProperty(newBeamName)
newBeamProperty = model.getBeamPropertyByName(newBeamName)

Set beam properties of “Beam at Y=0” to the new beam property.

beam_0.setProperty(newBeamProperty)

1.4 Set Beam Entity’s Installation Stage and Removal Stage#

Currently, both beams are installed at stage 1. Install the beam at stage 2 and remove at stage 4. Beams can be installed or removed by stage number or by stage name.

# install by stage number
beam_0.setInstallationStageByStageNumber(2)
beam_0.setRemovalStageByStageNumber(4)

# install by stage name
stage2Name = model.ProjectSettings.Stages.getName(2)
stage4Name = model.ProjectSettings.Stages.getName(4)
beam_10.setInstallationStageByStageName(stage2Name)
beam_10.setRemovalStageByStageName(stage4Name)

1.5 Set the Grouping of Beam Entities#

Create a group called “Beam Installation Group”

beamInstallationGroup = model.getAllGroups()[0]
beamInstallationGroupName = "Beam Installation Group"
beamInstallationGroup.setGroupName(beamInstallationGroupName)

Set both beams to this group at stage 2.

beam_0.setGrouping(2, beamInstallationGroupName)
beam_10.setGrouping(2, beamInstallationGroupName)

2. Bolt Control#

2.1 Select Bolt Entity#

Select bolts in the model by the same region for selecting the beams and include intersecting entities. All bolts in a bolt entity pattern will be selected together and the properties will be updated together.

bolts = model.Selection.getSupportEntities(SupportTypes.BOLT, cylinderRegion)
boltPattern1 = bolts[0]
boltPattern2 = bolts[1]

2.2 Rename Bolt Entity#

Rename both beams.

boltPattern1.setName("Tunnel Bolt Pattern 1")
boltPattern2.setName("Tunnel Bolt Pattern 2")

2.3 Set Bolt Property to Bolt Entity#

Create a new bolt property.

newBoltName = "New Bolt"
model.createNewBoltProperty(newBoltName)
newBoltProperty = model.getBoltPropertyByName(newBoltName)

Set both bolts with the new bolt property.

boltPattern1.setProperty(newBoltProperty)
boltPattern2.setProperty(newBoltProperty)

2.4 Set Bolt Entity’s Installation Stage and Removal Stage#

Currently, both bolts are installed at stage 1. Install the bolts at stage 4. Bolts can be installed by stage number or by stage name.

# install by stage number
boltPattern1.setInstallationStageByStageNumber(4)

# install by stage name
boltPattern2.setInstallationStageByStageName(stage4Name)

2.5 Set the Grouping of Bolt Entities#

Create a group called “Bolt Installation Group”.

boltInstallationGroup = model.getAllGroups()[1]
boltInstallationGroupName = "Bolt Installation Group"
boltInstallationGroup.setGroupName(boltInstallationGroupName)

Set both bolts to this group at stage 4.

boltPattern1.setGrouping(4, boltInstallationGroupName)
boltPattern2.setGrouping(4, boltInstallationGroupName)

3. Joint Control#

3.1 Select Joint Entity#

There is only one joint in the model, so index 0 will select the only joint.

joint = model.Entity.getAllSupportEntities(SupportTypes.JOINT)[0]

3.2 Rename Joint Entity#

Rename the joint surface.

joint.setName("Joint Surface")

3.3 Set Joint Property to Joint Entity#

Get the joint 2 property.

joint2Property = model.getAllJointProperties()[1]

Set the joint entity with joint 2 property.

joint.setProperty(joint2Property)

3.4 Set Joint Entity’s Installation Stage and Removal Stage#

Currently, joint is installed at stage 5. Now, install joint from stage 1.

# install by stage number
joint.setInstallationStageByStageNumber(1)

3.5 Set the Grouping of Joint Entities#

Create a group called “Joint Group”.

jointGroup = model.getAllGroups()[2]
jointGroupName = "Joint Group"
jointGroup.setGroupName(jointGroupName)

Set the joint to be in this group from stage 1.

joint.setGrouping(1, jointGroupName)

4. Composite Liner Control#

4.1 Select Composite Liner Entity#

Select composite liners in the model by defining a region. The same cylinderRegion can be reused.

compositeLiner = model.Selection.getSupportEntities(SupportTypes.COMPOSITE_LINER, cylinderRegion)[0]

4.2 Rename Composite Liner Entity#

Rename the composite liner to “Tunnel Composite Liner”

compositeLiner.setName("Tunnel Composite Liner")

4.3 Set Composite Liner Property to Composite Liner Entity#

Create a new composite liner property for the tunnel.

newCompositeLinerName = "Tunnel Liner"
model.createNewLiningCompositionProperty(newCompositeLinerName)
newCompositeLinerProperty = model.getLiningCompositionPropertyByName(newCompositeLinerName)

Set “Tunnel Liner” property to the new composite liner.

compositeLiner.setProperty(newCompositeLinerProperty)

4.4 Set Composite Liner Entity’s Installation Stage and Removal Stage#

Install composite liner at stage 3.

# install by stage number
compositeLiner.setInstallationStageByStageNumber(3)

4.5 Set the Grouping of Composite Liner Entities#

Create a group called “Composite Liner Installation Group”.

compositeLinerInstallationGroup = model.getAllGroups()[3]
compositeLinerInstallationGroupName = "Composite Liner Installation Group"
compositeLinerInstallationGroup.setGroupName(compositeLinerInstallationGroupName)

Set both beams to this group at stage 2.

compositeLiner.setGrouping(2, compositeLinerInstallationGroupName)

5. Pile Control#

5.1 Select Pile Entity#

Select beams in the model by defining a region and by name. The group pile is currently installed at stage 1. After defining the region, providing the stage number can further filter the piles. Single pile can be filtered by stage number as well.

groupPile = model.Selection.getSupportEntities(SupportTypes.PILE, Cube(Point(10, 8, -10), Point(25, 22, 2)), stageNumber=1)[0]
singlePile = model.Selection.getSupportEntities(SupportTypes.PILE, Cube(Point(10, 8, -10), Point(25, 22, 2)), stageNumber=2)[0]

5.2 Rename Pile Entity#

Rename both beams.

groupPile.setName("Pile Pattern")
singlePile.setName("Single Pile")

5.3 Set Pile Property to Pile Entity#

Get Pile 2 property.

newPileProperty = model.getPilePropertyByName("Pile 2")

Set the new pile property to the pile group.

groupPile.setProperty(newPileProperty)

5.4 Set Pile Entity’s Installation Stage and Removal Stage#

Set all piles to be installed at stage 5.

# install by stage number
groupPile.setInstallationStageByStageNumber(5)
singlePile.setInstallationStageByStageNumber(5)

5.5 Set the Grouping of Pile Entities#

Create a group called “Pile Installation Group”.

pileInstallationGroupName = "Pile Installation Group"
pileInstallationGroup = model.createNewGroupProperty(pileInstallationGroupName)

Set both beams to this group at stage 2.

groupPile.setGrouping(5, pileInstallationGroupName)
singlePile.setGrouping(5, pileInstallationGroupName)

Save and close the model.

model.close(True)

Close the program.

modeler.closeProgram()

Full Script#

# Support Control Script Examples
# Download the [blankSupportModel.rs3v3](https://github.com/Rocscience/rs3-scripting/tree/main/docs/example_code/example_models/blankSupportModel.rs3v3) for this example.
from rs3.RS3Modeler import RS3Modeler
import os
import shutil
from rs3.CommonEnums import SupportTypes
from rs3.Geometry import *


current_dir = os.path.dirname(os.path.abspath(""))

port = 60111
RS3Modeler.startApplication(port)

# Connect with the RS3 Modeler.
modeler = RS3Modeler(port)

# For the demonstration purposes only, the model is copied for reuse. 
# You may change the model path to your own model path.
blankModelPath = rf"{current_dir}\example_models\blankSupportModel.rs3v3"
copiedModelPath = rf"{current_dir}\example_models\copiedSupportModel.rs3v3"
_ = shutil.copy(blankModelPath, copiedModelPath)

# Open the copied model file.
model = modeler.openFile(copiedModelPath)

# 1. Beam Control
# 1.1 Select Beam Entity
# Select beams in the model by defining a region and by name.
cylinderRegion = Cylinder(Point(10, -1, -10), Point(10, 1, -10), 2)
beam_0 = model.Selection.getSupportEntities(SupportTypes.BEAM, cylinderRegion, includeIntersecting=False)[0]
beam_10 = model.Entity.getSupportEntityByName(SupportTypes.BEAM, "Beam 2")

# 1.2 Rename Beam Entity
# Rename both beams.
beam_0.setName("Beam at Y=0")
beam_10.setName("Beam at Y=10")

# 1.3 Set Beam Property to Beam Entity
# Create a new beam.
newBeamName = "New Beam"
model.createNewBeamProperty(newBeamName)
newBeamProperty = model.getBeamPropertyByName(newBeamName)

# Set beam properties of "Beam at Y=0" to the new beam property.
beam_0.setProperty(newBeamProperty)

# 1.4 Set Beam Entity's Installation Stage and Removal Stage
# Currently, both beams are installed at stage 1. Install the beam at stage 2 
# and remove at stage 4. Beams can be installed or removed by stage number or
# by stage name.
# install by stage number
beam_0.setInstallationStageByStageNumber(2)
beam_0.setRemovalStageByStageNumber(4)

# install by stage name
stage2Name = model.ProjectSettings.Stages.getName(2)
stage4Name = model.ProjectSettings.Stages.getName(4)
beam_10.setInstallationStageByStageName(stage2Name)
beam_10.setRemovalStageByStageName(stage4Name)

# 1.5 Set the Grouping of Beam Entities
# Create a group called "Beam Installation Group"
beamInstallationGroup = model.getAllGroups()[0]
beamInstallationGroupName = "Beam Installation Group"
beamInstallationGroup.setGroupName(beamInstallationGroupName)

# Set both beams to this group at stage 2.
beam_0.setGrouping(2, beamInstallationGroupName)
beam_10.setGrouping(2, beamInstallationGroupName)

# 2. Bolt Control
# 2.1 Select Bolt Entity
# Select bolts in the model by the same region for selecting the beams and include 
# intersecting entities. All bolts in a bolt entity pattern will be selected together 
# and the properties will be updated together.
bolts = model.Selection.getSupportEntities(SupportTypes.BOLT, cylinderRegion)
boltPattern1 = bolts[0]
boltPattern2 = bolts[1]

# 2.2 Rename Bolt Entity
# Rename both beams.
boltPattern1.setName("Tunnel Bolt Pattern 1")
boltPattern2.setName("Tunnel Bolt Pattern 2")

# 2.3 Set Bolt Property to Bolt Entity
# Create a new bolt property.

newBoltName = "New Bolt"
model.createNewBoltProperty(newBoltName)
newBoltProperty = model.getBoltPropertyByName(newBoltName)

# Set both bolts with the new bolt property.
boltPattern1.setProperty(newBoltProperty)
boltPattern2.setProperty(newBoltProperty)

# 2.4 Set Bolt Entity's Installation Stage and Removal Stage
# Currently, both bolts are installed at stage 1. Install the bolts at stage 4. 
# Bolts can be installed by stage number or by stage name.
# install by stage number
boltPattern1.setInstallationStageByStageNumber(4)

# install by stage name
boltPattern2.setInstallationStageByStageName(stage4Name)

# 2.5 Set the Grouping of Bolt Entities
# Create a group called "Bolt Installation Group".
boltInstallationGroup = model.getAllGroups()[1]
boltInstallationGroupName = "Bolt Installation Group"
boltInstallationGroup.setGroupName(boltInstallationGroupName)

# Set both bolts to this group at stage 4.
boltPattern1.setGrouping(4, boltInstallationGroupName)
boltPattern2.setGrouping(4, boltInstallationGroupName)

# 3. Joint Control
# 3.1 Select Joint Entity
# There is only one joint in the model, so index 0 will select the only joint.
joint = model.Entity.getAllSupportEntities(SupportTypes.JOINT)[0]

# 3.2 Rename Joint Entity
# Rename the joint surface.
joint.setName("Joint Surface")

# 3.3 Set Joint Property to Joint Entity
# Get the joint 2 property.
joint2Property = model.getAllJointProperties()[1]

# Set the joint entity with joint 2 property.
joint.setProperty(joint2Property)

# 3.4 Set Joint Entity's Installation Stage and Removal Stage
# Currently, joint is installed at stage 5. Now, install joint from stage 1.
# install by stage number
joint.setInstallationStageByStageNumber(1)

# 3.5 Set the Grouping of Joint Entities
# Create a group called "Joint Group".
jointGroup = model.getAllGroups()[2]
jointGroupName = "Joint Group"
jointGroup.setGroupName(jointGroupName)

# Set the joint to be in this group from stage 1.
joint.setGrouping(1, jointGroupName)

# 4. Composite Liner Control
# 4.1 Select Composite Liner Entity
# Select composite liners in the model by defining a region. The same cylinderRegion can be reused.
compositeLiner = model.Selection.getSupportEntities(SupportTypes.COMPOSITE_LINER, cylinderRegion)[0]

# 4.2 Rename Composite Liner Entity
# Rename the composite liner to "Tunnel Composite Liner"
compositeLiner.setName("Tunnel Composite Liner")

# 4.3 Set Composite Liner Property to Composite Liner Entity
# Create a new composite liner property for the tunnel.
newCompositeLinerName = "Tunnel Liner"
model.createNewLiningCompositionProperty(newCompositeLinerName)
newCompositeLinerProperty = model.getLiningCompositionPropertyByName(newCompositeLinerName)

# Set "Tunnel Liner" property to the new composite liner.
compositeLiner.setProperty(newCompositeLinerProperty)

# 4.4 Set Composite Liner Entity's Installation Stage and Removal Stage
# Install composite liner at stage 3.

# install by stage number
compositeLiner.setInstallationStageByStageNumber(3)

# 4.5 Set the Grouping of Composite Liner Entities
# Create a group called "Composite Liner Installation Group".
compositeLinerInstallationGroup = model.getAllGroups()[3]
compositeLinerInstallationGroupName = "Composite Liner Installation Group"
compositeLinerInstallationGroup.setGroupName(compositeLinerInstallationGroupName)

# Set both beams to this group at stage 2.
compositeLiner.setGrouping(2, compositeLinerInstallationGroupName)

# 5. Pile Control
# 5.1 Select Pile Entity
# Select beams in the model by defining a region and by name. The group pile is currently installed 
# at stage 1. After defining the region, providing the stage number can further filter the piles. 
# Single pile can be filtered by stage number as well.
groupPile = model.Selection.getSupportEntities(SupportTypes.PILE, Cube(Point(10, 8, -10), Point(25, 22, 2)), stageNumber=1)[0]
singlePile = model.Selection.getSupportEntities(SupportTypes.PILE, Cube(Point(10, 8, -10), Point(25, 22, 2)), stageNumber=2)[0]

# 5.2 Rename Pile Entity
# Rename both beams.
groupPile.setName("Pile Pattern")
singlePile.setName("Single Pile")

# 5.3 Set Pile Property to Pile Entity
# Get Pile 2 property.
newPileProperty = model.getPilePropertyByName("Pile 2")

# Set the new pile property to the pile group.
groupPile.setProperty(newPileProperty)

# 5.4 Set Pile Entity's Installation Stage and Removal Stage
# Set all piles to be installed at stage 5.
# install by stage number
groupPile.setInstallationStageByStageNumber(5)
singlePile.setInstallationStageByStageNumber(5)

# 5.5 Set the Grouping of Pile Entities
# Create a group called "Pile Installation Group".
pileInstallationGroupName = "Pile Installation Group"
pileInstallationGroup = model.createNewGroupProperty(pileInstallationGroupName)

# Set both beams to this group at stage 2.
groupPile.setGrouping(5, pileInstallationGroupName)
singlePile.setGrouping(5, pileInstallationGroupName)

# Save and close the model.
model.close(True)
2026-09-16 16:51:54,904 - Rocscience.RS3 - INFO - Attempting to start the application at C:\Program Files\Rocscience\RS3\RS3 and binding server to port 60111...