Support Properties: Basic Example#

Download the ExampleModel.slmd for this example.

Code Snippet: Support Property Manipulation#
from Slide2Scripting.Slide2Modeler import Slide2Modeler
from Slide2Scripting.Utilities.ColorPicker import ColorPicker
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")

supports = model.getSupportProperties()
if not supports:
	support = model.addSupportProperty()
else:
	support = supports[0]
support.setName("Support Type A")
support.setColor(ColorPicker.Indigo)
print(support.getName())
print(ColorPicker.getColorName(support.getColor()))

model.save()
model.close()

slide2_modeler.closeApplication()

Output#

Support Type A
Indigo