Model.modent_addcontentsbymark#

Model.modent_addcontentsbymark(modular_entity, content_collection, representation_key=s_defaultString, position=0)#

Adds entities to a modular entity via a collection.

Include contents will be merged.

Parameters:
  • modular_entity (Entity) – The object describing the modular entity to update. Valid entities are subsystemconfigurations, subsystems and subsystemsets.

  • content_collection (Collection) – The collection containing the entities to add.

  • representation_key (hwString) – The representation key of the subsystem to populate. This defaults to the only realized representation and can be omitted.

  • position (unsigned int) –

    Flag indicating whether to reposition the added entities using the target subsystem’s transformation matrix.

    0 - Do not reposition

    1 - Reposition using the target subsystem’s transformation matrix

Example#

Add components with IDs 4, 6 and 8 under subsystem with ID 2#
import hm
import hm.entities as ent

model = hm.Model()

subsys2 = ent.Subsystem(model, 2)

comp_col = hm.Collection(model, ent.Component, [4, 6, 8])

model.modent_addcontentsbymark(
    modular_entity=subsys2,
    content_collection=comp_col,
)