Model.clearallidranges#

Model.clearallidranges(id_or_type, mode)#

Clears all ID ranges for various portions of a model.

Parameters:
  • id_or_type (hwString) – The submodel ID or entity type, depending on the requested mode.

  • mode (hwString) –

    bymodel - Clear all ID ranges in the whole model.

    bysubmodel - Clear all ID ranges in a submodel.

    byentities - Clear all ID ranges on an entity type in the whole model.

    byexcludedmodel - Clear all excluded IDs in the whole model.

    byexcludedsubmodel - Clear all excluded IDs in a submodel.

    byexcludedentities - Clear all excluded IDs on an entity type in the whole model.

Examples#

Clear all ID ranges for the whole model#
import hm
import hm.entities as ent

model = hm.Model()

model.clearallidranges(id_or_type="0", mode="bymodel")
Clear all ID ranges for an include#
import hm
import hm.entities as ent

model = hm.Model()

model.clearallidranges(id_or_type="$include_id", mode="bysubmodel")
Clear ID ranges for all comps in the model#
import hm
import hm.entities as ent

model = hm.Model()

model.clearallidranges(id_or_type="comps", mode="byentities")
Clear all excluded IDs in the whole model#
import hm
import hm.entities as ent

model = hm.Model()

model.clearallidranges(id_or_type="0", mode="byexcludedmodel")
Clear all excluded IDs in an include#
import hm
import hm.entities as ent

model = hm.Model()

model.clearallidranges(id_or_type="$include_id", mode="byexcludedmodel")
Clear excluded in an entity type cross the model#
import hm
import hm.entities as ent

model = hm.Model()

model.clearallidranges(id_or_type="groups", mode="byexcludedentities")