Model.createentitysameas#

Model.createentitysameas(entities, entityname='yes')#

Creates a new entity that is a clone of the original. Attributes and data names are both cloned, however, collected entities are not cloned along with collectors. There are also a few limitations to this function: Rigid wall entities are not supported.

Parameters:
  • entities (Entity) – The original entity.

  • entityname (hwString) – The name of the new entity.

Example#

Duplicate the component with ID 100#
import hm
import hm.entities as ent

model = hm.Model()

model.createentitysameas(entities=ent.Component(model, 100))
Duplicate the component with ID 100 with the new component named “ comp01 ”#
import hm
import hm.entities as ent

model = hm.Model()

model.createentitysameas(entities=ent.Component(model, 100), entityname="comp01")