Material Properties: Anisotropic Example#

Download the ExampleModel.slmd for this example.

Code Snippet: Anisotropic 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.ANISOTROPIC)
props = material.StrengthProperties.Anisotropic
props.setCohesion1(10.0)
props.setCohesion2(15.0)
props.setPhi1(30.0)
props.setPhi2(35.0)

print(props.getCohesion1())
print(props.getCohesion2())
print(props.getPhi1())
print(props.getPhi2())

model.save()
model.close()

slide2_modeler.closeApplication()

Output#

10.0
15.0
30.0
35.0