Model.clearunusedunresolvedids#

Model.clearunusedunresolvedids(entity_type)#

Audits the list of unresolved ID references and discards any which are no longer needed.

Suppose you have a property that refers to a material with ID=17, but that material is not presently defined in the database. will preserve that slot in the database as an unresolved ID, so that you won’t accidentally overwrite it and corrupt that reference. If, in the future, you import a solver deck file that includes a definition for that material, the property will automatically now refer to it, resolving the reference.

Instead, if you delete the property, and no other entity in the database refers to that material, then HyperMesh doesn’t need to preserve a slot for some future material with ID=17. It continues to preserve the slot, on the assumption that material will eventually be defined for the model you are working on.

Parameters:

entity_type (EntityFullType) – The type of entity to update the unresolved ID list for.

Example#

Discard unresolved material IDs, that are no longer required by any entity currently defined in the model#
import hm
import hm.entities as ent

model = hm.Model()

model.clearunusedunresolvedids(entity_type=ent.Material)