mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
get_total_inverses now efficiently gets the full number of references to an entity
This commit is contained in:
committed by
Thomas Krijnen
parent
cef1c86f6d
commit
5ad6d455f9
@@ -391,15 +391,15 @@ class file(object):
|
||||
return inverses
|
||||
return set(inverses)
|
||||
|
||||
def get_inverse_cardinality(self, inst):
|
||||
def get_total_inverses(self, inst):
|
||||
"""Returns the number of entities that reference this entity
|
||||
|
||||
:param inst: The entity instance to get inverse relationships
|
||||
:type inst: ifcopenshell.entity_instance.entity_instance
|
||||
:returns: 0 if no references, 1 if one reference, or 2 if more than one reference
|
||||
:returns: The total number of references
|
||||
:rtype: int
|
||||
"""
|
||||
return self.wrapped_data.get_inverse_cardinality(inst.wrapped_data)
|
||||
return self.wrapped_data.get_total_inverses(inst.wrapped_data)
|
||||
|
||||
def remove(self, inst):
|
||||
"""Deletes an IFC object in the file.
|
||||
|
||||
Reference in New Issue
Block a user