mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user