Model.ME_ModuleOccurrenceCreate#

Model.ME_ModuleOccurrenceCreate(name, parent_part_entity=Entity(), structural_type='', udm_id='')#

Creates a module part.

Parameters:
  • name (hwString) – The name of the part module to create.

  • parent_part_entity (Entity) – The object describing the part entity you wish to make this module a child of. If not specified, the new module is placed underneath the root model module.

  • structural_type (hwString) –

    part

    A part is the default if not specified, and can coverts to a part assembly. A part assembly cannot be converted to a part.

  • udm_id (hwString) – The string ID from a UDM XML file for this part, if necessary.

Example#

Create a new Part module named “mypartname” as a child of the module with ID 2#
import hm
import hm.entities as ent

model = hm.Model()

model.ME_ModuleOccurrenceCreate(
    name="mypartname", parent_part_entity=ent.Part(model, 2), structural_type="part"
)