Model.ME_ModuleRepresentationDetailAction#

Model.ME_ModuleRepresentationDetailAction(part_entity, key, action, metadata_name, metadata_value, metadata_type, type='')#

Sets or removes representation metadata. Either an occurrence or a prototype can be given. If occurrence ID is given, representation should have been at least added to specific occurrence prior metadata configuration. The metadata attribute and value are being provided via options.

Parameters:
  • part_entity (Entity) – The object describing the part entity to perform the representation detail action..

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

  • action (hwString) – The detail action to perform (set or remove).

  • metadata_name (hwString) – The name of the metadata.

  • metadata_value (hwString) – The value of the metadata.

  • metadata_type (hwString) – The type of the metadata.

  • type (hwString) – Reserved for future development.

Example#

Set metadata to the “RepCAD” representation of part with ID 5#
import hm
import hm.entities as ent

model = hm.Model()

model.ME_ModuleRepresentationDetailAction(
    part_entity=ent.Part(model, 5),
    key="RepCAD",
    action="set",
    metadata_name="test",
    metadata_value="test_value",
    metadata_type="string",
)