Model.modent_applyconfiguration#
- Model.modent_applyconfiguration(entity, apply)#
Applies or unapplies a subsystem configuration. This function allows activating or deactivating a specific configuration of subsystems.
Only one configuration can be applied at a time. By applying a new configuration, any previously applied configuration will be automatically unapplied. Subsystems that do not belong to any configuration are considered active by default. When a configuration is unapplied, all subsystems are set to active, regardless of their previous configuration membership.
When a connector exists between active subsystems, the connector is also activated automatically.
- Parameters:
entity (Entity) – The configuration entity to apply. Currently supported only for subsystem configurations.
apply (int) – Specifies whether to apply or unapply the configuration (0 - unapply, 1 - apply).
Example#
Apply a subsystem configuration with ID 1#import hm import hm.entities as ent model = hm.Model() config_entity = ent.Subsystemconfiguration(model,1) model.modent_applyconfiguration(entity=config_entity, apply=1)
Unapply a subsystem configuration with ID 2#import hm import hm.entities as ent model = hm.Model() config_entity = ent.Subsystemconfiguration(model,2) model.modent_applyconfiguration(entity=config_entity, apply=0)