resource.remove_resource - fix bug removing IfcRelAssignsToResource

tuple(resource) was resulting in (GlobalId, OwnerHistory, Name, ...) instead of (resource,), so the check never passed and orphaned IfcRelAssignsToResource was never removed.
This commit is contained in:
Andrej730
2024-11-14 15:27:51 +05:00
parent 1f21e96887
commit 6c26403b9c
@@ -65,7 +65,7 @@ def remove_resource(file: ifcopenshell.file, resource: ifcopenshell.entity_insta
ifcopenshell.api.resource.unassign_resource(
file, related_object=related_object, relating_resource=settings["resource"]
)
elif inverse.RelatedObjects == tuple(settings["resource"]):
elif inverse.RelatedObjects == (resource,):
remove_consider_history(inverse)
# Usage was added in IFC4.
if usage := getattr(settings["resource"], "Usage", None):