Model.ME_ModuleRepresentationAddFile2#

Model.ME_ModuleRepresentationAddFile2(part_entity, key, fileformat, filename)#

Adds a representation file to a part or a part assembly prototype. Either an occurrence or a prototype can be given.

Parameters:
  • part_entity (Entity) – The object describing the part entity for which to add the representation file.

  • key (hwString) – The representation key (name).

  • fileformat (hwString) – The representation file format (for example, JT).

  • filename (hwString) – The representation file name (complete file path).

Example#

Add a representation file to part with ID 5#
import hm
import hm.entities as ent

model = hm.Model()

model.ME_ModuleRepresentationAddFile2(
    part_entity=ent.Part(model, 5),
    key="RepCAD",
    fileformat="JT",
    filename="S:/ALT13120121_003_XML71.jt",
)