Model.ME_ModuleOccurrencesCreateByComponentMark#

Model.ME_ModuleOccurrencesCreateByComponentMark(component_collection, options)#

Moves a list of components in the collection to the new parts created under the parent assembly in the model hierarchy. It will also move the connected components to the newly created parts. If the connected components have a part associated, then it will move the components to the existing part.

Parameters:
  • component_collection (Collection) – The collection containing the component entities to move.

  • options (hwString) –

    The string containing the options. The following options can be defined in the string following <name>=<value> format and separated by space. The order of options does not matter. If an option is not defined in the string, the default value will be used. Valid options are:

    • parent_id=<value>

      The ID of the part assembly to become the parent of the new parts created.

    • part_createmethod=<value>

      The flag to create part per component or part per connected components.

      component - To create part per component.

      connectedcomponent - To create part per connected components. (default)

Example#

Place the components with ID 100 , 101 and 102 under part assembly ID 8 in the hierarchy . New part will be created under parent ID 8 for all the component IDs . If the components are connected , they will be placed under one part#
import hm
import hm.entities as ent

model = hm.Model()

component_collection = hm.Collection(model, ent.Component, [100, 101, 102])

model.ME_ModuleOccurrencesCreateByComponentMark(
    component_collection=component_collection,
    options="parent_id=8",
)