Pile Sections (Driven)#

Download the DrivenPile.rspile2 for this example.

Code Snippet: Manipulation of Pile Sections (Driven)#
from RSPileScripting.RSPileModeler import RSPileModeler
from RSPileScripting.enums import *
from RSPileScripting.Utilities.ColorPicker import ColorPicker
import os, inspect

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

rspile_modeler = RSPileModeler(60044)
model = rspile_modeler.openFile(rf"{current_dir}\example_models\DrivenPile.rspile2")

pile_section_list = model.getPileSections()

pile_section1 = pile_section_list[0]
pile_section2 = pile_section_list[1]

pile_section1.setName("Timber Pile Section")
pile_section1.setColor(ColorPicker.Rose)
pile_section1.DrivenCapacity.setCrossSectionType(DrivenCrossSectionType.TIMBER_PILE)
pile_section1.DrivenCapacity.Timber.setDiameterOfPile(0.6)

pile_section2.setName("H Pile Section")
pile_section2.setColor(ColorPicker.Gold)
pile_section2.DrivenCapacity.setCrossSectionType(DrivenCrossSectionType.H_PILE)
pile_section2.DrivenCapacity.HPile.setHPileTypeMetric(HPileTypeMetric.HP_360x132)
pile_section2.DrivenCapacity.HPile.setHPilePerimeter(HPilePerimeter.H_BOX_PERIMETER)
pile_section2.DrivenCapacity.HPile.setHPileArea(HPileArea.H_PILE_AREA)

print(pile_section1.getName())
print(ColorPicker.getColorName(pile_section1.getColor()))
print(pile_section1.DrivenCapacity.getCrossSectionType())
print(pile_section1.DrivenCapacity.Timber.getDiameterOfPile())

print(pile_section2.getName())
print(ColorPicker.getColorName(pile_section2.getColor()))
print(pile_section2.DrivenCapacity.getCrossSectionType())
print(pile_section2.DrivenCapacity.HPile.getHPileTypeMetric())
print(pile_section2.DrivenCapacity.HPile.getHPilePerimeter())
print(pile_section2.DrivenCapacity.HPile.getHPileArea())

model.save()
model.close()

rspile_modeler.closeApplication()

Output#

Timber Pile Section
Rose
DrivenCrossSectionType.TIMBER_PILE
0.6
H Pile Section
Gold
DrivenCrossSectionType.H_PILE
HPileTypeMetric.HP_360x132
HPilePerimeter.H_BOX_PERIMETER
HPileArea.H_PILE_AREA