Model.ME_ModuleOccurrenceInstancesDetach#
- Model.ME_ModuleOccurrenceInstancesDetach(part_list, options)#
Breaks a list of module occurrences from their current prototype and re-assigns them to new prototypes.
Every module occurrence in a model has an associated module prototype that it came from. A single module prototype may provide the base for multiple module occurrences, that is, a prototype of a wheel, might have four occurrences in a vehicle.
This function is applied to a list of occurrences that are a subset of all the instances of a common, original prototype, that is, the 2 right side wheels of the vehicle. It will break the existing links with the original prototype for the specified occurrences so they can have their own, unique definition. A new, cloned version of the original prototype will be created, and the specified occurrences will be re-linked to the new prototype, which provides the basis of this new definition.
In the case of a multi-level instanced assembly, the function will also appropriately handle the assembly instances to create and re-link additional prototype clones of assemblies as required. Finally, based on the options provided, the function will perform additional operations (that is, copying attributes) between the original structure and the new cloned entities.
- Parameters:
part_list (EntityList) – A list containing the entity objects.
options (hwString) –
The list of input options, passed as a comma separated string enclosed in quotes. Valid options are:
copyprotoattribs=<value>
NONE - Do not copy any attributes from original prototypes to newly created cloned prototypes
HW_PDM - Copy the PDM attributes from original prototypes to newly created cloned prototypes
Example#
Break the module occurrences with IDs 22 and 24 from their current prototype and re-assign them to newly created prototypes which are assigned the PDM attributes from the original prototypes#import hm import hm.entities as ent model = hm.Model() model.ME_ModuleOccurrenceInstancesDetach( part_list=[ent.Part(model, 22), ent.Part(model, 24)], options="copyprotoattribs=HW_PDM", )