Model.createidrange#

Model.createidrange(submodel_type, id, shortname, entity_type, min_id, max_id, pool_id, integer_array)#

Creates an ID range for a submodel.

Parameters:
  • submodel_type (hwString) – Submodel type to create the ID range for. Valid values are includes and includefiles.

  • id (unsigned int) – The ID of the submodel. Not required, if shortname is used.

  • shortname (hwString) – The shortname of the submodel. Not required, if id is used.

  • entity_type (hwString) – Entity type to create the ID range for.

  • min_id (unsigned int) – The minimum ID for the range.

  • max_id (unsigned int) – The maximum ID for the range.

  • pool_id (unsigned int) – The ID of the solver pool.

  • integer_array (hwIntList) – The ID of the integer array that contains the locked IDs. This should always be set to 1.

Example#

Create an ID range for include 1 with min ID 1000 and max ID 100000 for components#
import hm
import hm.entities as ent

model = hm.Model()

model.createidrange(
    submodel_type="includes",
    id=1,
    shortname="",
    entity_type=ent.Component(model),
    min_id=1000,
    max_id=100000,
    pool_id=0,
    integer_array=[1]
)
Create an ID range for include 1 with min ID 1,000 and max ID 100,000 for components , with locked IDs 2000 and 5000#
import hm
import hm.entities as ent

model = hm.Model()

model.createidrange(
    submodel_type="includes",
    id=1,
    shortname="",
    entity_type=ent.Component(model),
    min_id=1000,
    max_id=100000,
    pool_id=0,
    integer_array=[2000,5000]
)