From 871710a0aa9ad42883a6bee98d846b2754ab4d2d Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 29 Jan 2025 16:00:56 +0500 Subject: [PATCH] Fix remove_representation error #6059 After to_delete was explicitly added as an attribute to ifcopenshell.file (previously it was kind of hacky assigned during batch remove). --- .../ifcopenshell/api/geometry/remove_representation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/remove_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/remove_representation.py index 7aafb751e0..82e8330add 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/remove_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/remove_representation.py @@ -66,7 +66,7 @@ def remove_representation(file: ifcopenshell.file, representation: ifcopenshell. for colour in colours: ifcopenshell.util.element.remove_deep2(file, colour) - to_delete = getattr(file, "to_delete", ()) + to_delete = file.to_delete or set() for element in styled_items: if not element.Item or element.Item in to_delete: file.remove(element)