Model.renumbersolverid#

Model.renumbersolverid(collection, start_id, incr_val, offset_val, offset_flag, reserved_1, reserved_2, reserved_3)#

Renumbers the solver IDs for entities contained on collection.

Works in two ways depending on the entities selected. If the selected entities have solver IDs, the function will renumber the solver IDs and not the internal IDs. However, if the selected entities do not have solver IDs, the function will renumber the internal IDs (see Model.renumber()).

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.

  • reserved_1 (int) – Reserved for future development. Value = 0

  • reserved_2 (int) – Reserved for future development. Value = 0

  • reserved_3 (double) – Reserved for future development. Value = 0.0.

Example#

Renumbere the solver 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.renumbersolverid(
    collection=hm.CollectionByDisplayed(model, ent.Element),
    start_id=100,
    incr_val=1,
    offset_val=0,
    offset_flag=0,
    reserved_1=0,
    reserved_2=0,
    reserved_3=0.0,
)