Model.modent_clonebymark#
- Model.modent_clonebymark(input_collection, output_collection, copy_contents=True, delta_matrix=hwMatrix44(1.0))#
Creates instances of existing modular entities, that is, it adds a new instance on their prototypes and realizes the newly created occurrences.
Before cloning a subsystem its representation must be saved.
- Parameters:
input_collection (Collection) – The collection containing the modular entities to be cloned. Valid entities are subsystems.
output_collection (Collection) – The collection containing the entities that have been cloned as a result.
copy_contents (bool) –
0 - Do not clone contents on the cloned modular entity.
1 - Clone contents on the cloned modular entity (default).
delta_matrix (hwMatrix44) – The transformation to apply to the cloned modular entity in respect to its cloned initial position.
Example#
Cloning subsystems with ID 2 and 3 by copying their contents, translating them by 100 points in x axis and get the cloned subsystems in output collection#import hm import hm.entities as ent model = hm.Model() out_collection = hm.Collection(model, ent.Subsystem, populate=False) model.modent_clonebymark( input_collection=hm.Collection(model, ent.Subsystem[1, 2, 3]), output_collection=out_collection, copy_contents=1, delta_matrix=[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1], )