Material Properties: Undrained Example#
Download the ExampleModel.slmd for this example.
Code Snippet: Undrained Example#
from Slide2Scripting.Slide2Modeler import Slide2Modeler
from Slide2Scripting.MaterialProperties.MaterialStrength import StrengthType
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
Slide2Modeler.startApplication(60074)
slide2_modeler = Slide2Modeler(60074)
model = slide2_modeler.openFile(rf"{current_dir}\example_models\ExampleModel.slmd")
material = model.getMaterialProperties()[0]
material.StrengthProperties.setStrengthType(StrengthType.UNDRAINED)
props = material.StrengthProperties.Undrained
props.setCohesion(25.0)
props.setCohesionDatum(0.0)
props.setCohesionChange(1.5)
print(props.getCohesion())
print(props.getCohesionDatum())
print(props.getCohesionChange())
model.save()
model.close()
slide2_modeler.closeApplication()
Output#
25.0
0.0
1.5