mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Experimental get_inverse_cardinality proposal. See #1904.
This commit is contained in:
committed by
Thomas Krijnen
parent
d1caa3242f
commit
cef1c86f6d
@@ -391,6 +391,16 @@ class file(object):
|
||||
return inverses
|
||||
return set(inverses)
|
||||
|
||||
def get_inverse_cardinality(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
|
||||
:rtype: int
|
||||
"""
|
||||
return self.wrapped_data.get_inverse_cardinality(inst.wrapped_data)
|
||||
|
||||
def remove(self, inst):
|
||||
"""Deletes an IFC object in the file.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user