Model.ME_ModuleOccurrenceBackPropagate#

Model.ME_ModuleOccurrenceBackPropagate(part_entity, options)#

Every occurrence has an associated prototype that it came from. A single prototype may provide the base for multiple occurrences (like a prototype of a wheel, might have four occurrences in a vehicle). Once automatic splitting is enabled, any modification that may happen in an occurrence, will cause it to be separated (split) from its original prototype, to a new prototype of its own, containing all the modifications made.

This function will push all modification made in this separated occurrence and merge them back with its original prototype. This will cause all occurrences based on this original prototype to inherit those changes. The prototype of the once separated occurrence will after that be deleted. In the wheel/vehicle example, all modifications made to the split wheel will be pushed back to its original prototype and thus to all the rest of the wheels, thus having now only one prototype for all four wheel occurrences.

Parameters:
  • part_entity (Entity) – The object describing the part entity of which changes will be back propagated.

  • options (hwString) –

    List of input options, passed as a comma separated string enclosed in quotes. Valid options are:

    propagate_downwards=<value>

    • 0 - Do not propagate changes of prototypes downwards in the prototype hierarchy.

    • 1 - Default. Propagate changes of prototypes downwards in the prototype hierarchy.

    propagate_upwards=<value>

    • 0 - Do not propagate changes of prototypes upwards in the prototype hierarchy.

    • 1 - Default. Propagate changes of prototypes upwards in the prototype hierarchy.

Example#

Propagate changes for part with ID 100 both upwards and downwards#
import hm
import hm.entities as ent

model = hm.Model()

model.ME_ModuleOccurrenceBackPropagate(
    part_entity=ent.Part(model, 10),
    options="propagate_upwards=1, propagate_downwards=1",
)