Model.hm_getunusedoremptyentities_byentity#

Model.hm_getunusedoremptyentities_byentity(mode, outputCollectionSet, entity)#

Returns empty or unused entities, and places them on a collection. The return value is a list of lists. Each sub-list contains the empty or unused entity type as its first value, and the found entity IDs as the remainder of the sub-list.

Parameters:
  • mode (hwString) – The query mode. Valid values are empty, unused, and unusedempty.

  • outputCollectionSet (CollectionSet) – The set of collections containing possibly multiple type of entities.

  • entity (Entity) – The single entity to query.

Returns:

Example#

Get the the empty sets out of set entity with ID 1#
import hm
import hm.entities as ent

model = hm.Model()

output = hm.CollectionSet(model)

_, resultlist = model.hm_getunusedoremptyentities_byentity(
    mode="unused",
    outputCollectionSet=output,
    entity=ent.Set(model, 1)
)

for result in resultlist:
    print("entityType:", result.entityType)
    print("entityIds:", result.entityIds)