set_objects_temperature#

Modeler2D.set_objects_temperature(assignment: list, ambient_temperature: int = 22, create_project_var: bool = False) → bool#

Assign temperatures to objects.

The materials assigned to the objects must have a thermal modifier.

Parameters:
assignmentlist

List of objects.

ambient_temperaturefloat, optional

Ambient temperature. The default is 22.

create_project_varbool, optional

Whether to create a project variable for the ambient temperature. The default is False. If True, $AmbientTemp is created.

Returns:
bool

True when successful, False when failed.

References

>>> oDesign.SetObjectTemperature

Examples

>>> from ansys.aedt.core import Hfss
>>> app = Hfss()
>>> box = app.modeler.create_box([0, 0, 0], [10, 10, 10])
>>> app.modeler.set_objects_temperature(assignment=box.name)