Model.applyscenario#

Model.applyscenario(scenario_name, entity_type, overwrite_attrib, realize)#

Applies control and optionally realizes it. This works on any given supported entity type or on all the supported entities. Once the entity is filtered and the control is applied, same entity is ignored from next definitions.

Parameters:
  • scenario_name (hwString) – The name of the scenario to apply.

  • entity_type (hwString) – The entity type the scenario will be applied to. Valid values are connectors, attachments, and all.

  • overwrite_attrib (int) –

    The flag defining the behavior related to any delta values on the engineering entity. Valid values are:

    1 - Overwrite attributes

    2 - Keep local

    3 - Keep existing value

  • realize (int) –

    The option to realize the entities after applying the control.

    0 - Do not realize just apply control.

    1 - Realize after applying control.

Examples#

Apply control for connectors and realize them by overwrite local values from controls in scenario name Crash#
import hm
import hm.entities as ent

model = hm.Model()

model.applyscenario(
    scenario_name="Crash", entity_type="connectors", overwrite_attrib=1, realize=1
)
Apply control for all the supported entities and realize them by keep exist value of overwrite attribute flag in scenario name NVH#
import hm
import hm.entities as ent

model = hm.Model()

model.applyscenario(
    scenario_name="NVH", entity_type="all", overwrite_attrib=3, realize=1
)