Model.renumber#

Model.renumber(collection, start_id, incr_val, offset_val, offset_flag)#

Renumbers the internal HyperMesh IDs for entities contained on collection.

This function only renumbers HyperMesh internal IDs, even if the selected entities have solver IDs (see Model.renumbersolverid()).

Parameters:
  • collection (Collection) – The collection containing the entities for renumbering.

  • start_id (unsigned int) – Integer value > 0 specifying the starting value.

  • incr_val (unsigned int) – Integer value > 0 specifying the renumbering increment.

  • offset_val (int) – Integer value to use for offsetting. It can be positive or negative as long as after renumbering all entities will have a positive ID.

  • offset_flag (int) –

    Flag to specify whether to use offsetting:

    0 - Use start_id and incr_val and ignore offset_val.

    1 - Use offset_val and ignore start_id and incr_val.

Example#

Renumbere the internal HyperMesh IDs of the displayed elements start from ID 100 with an increment of 1#
import hm
import hm.entities as ent

model = hm.Model()

model.renumber(
    collection=hm.CollectionByDisplayed(model, ent.Element),
    start_id=100,
    incr_val=1,
    offset_val=0,
    offset_flag=0,
)