Model.ME_ModuleRepresentationAdd2#

Model.ME_ModuleRepresentationAdd2(part_entity, key, type, udm_rep_ref_id='')#

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

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

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

  • type (hwString) – The representation type.

  • udm_rep_ref_id (hwString) – Reserved for future use.

Example#

Add a “RepCAD” representation of type CAD to part ID 5#
import hm
import hm.entities as ent

model = hm.Model()

model.ME_ModuleRepresentationAdd2(
    part_entity=ent.Part(model, 5), key="RepCad", type="CAD"
)