Model.modent_instancessynccontents#

Model.modent_instancessynccontents(sourceEntity, targetCollection=Collection())#

Synchronizes the contents of instanced subsystems. This function updates the contents of target instanced subsystems to match the contents of the source subsystem, ensuring all instances have synchronized content. This is useful when modifications are made to one instance and need to be propagated to other instances.

Parameters:
  • sourceEntity (Entity) – The source subsystem entity.

  • targetCollection (Collection) – The collection containing specific instances to synchronize.

Example#

Synchronize all instances of the same subsystem prototype with ID 101#
import hm
import hm.entities as ent

model = hm.Model()

model.modent_instancessynccontents(ent.Subsystem(model, 101))
Synchronize only specific target subsytem instances with ID 102, 103, 104 based on the subsystem ID 101#
import hm
import hm.entities as ent

model = hm.Model()

target_subs_col = hm.Collection(model,ent.Subsystem,[102, 103, 104])
model.modent_instancessynccontents(ent.Subsystem(model, 101), targetMark=target_subs_col)