Model.hm_attributereferencecount#

Model.hm_attributereferencecount(entity)#

Returns the number of times an entity is referenced as an entity attribute.

Parameters:

entity (Entity) – The object describing the entity to query.

Returns:

Example#

Get the number of times the material with ID 6 is referenced as an entity attribute#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_attributereferencecount(entity=ent.Material(model,6))

print("Number of times:", result.referenceCount)