From 358c8344278b5551ffb9ce0bcbd93412ce0c212d Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 22 Aug 2024 17:56:18 +0500 Subject: [PATCH] fix bim tests after 143e094 drawings and annotations that are part of some drawing don't need to be added to the spatial hierarchy --- src/bonsai/bonsai/tool/root.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/tool/root.py b/src/bonsai/bonsai/tool/root.py index 689dfe7531..e61a0c3326 100644 --- a/src/bonsai/bonsai/tool/root.py +++ b/src/bonsai/bonsai/tool/root.py @@ -170,7 +170,15 @@ class Root(bonsai.core.tool.Root): @classmethod def is_containable(cls, element: ifcopenshell.entity_instance) -> bool: - return element.is_a("IfcElement") or element.is_a("IfcAnnotation") or element.is_a("IfcGrid") + if element.is_a("IfcElement") or element.is_a("IfcGrid"): + return True + if element.is_a("IfcAnnotation"): + if element.ObjectType == "DRAWING": + return False + drawing_group = tool.Drawing.get_drawing_group(element) + if not drawing_group: + return True + return False @classmethod def is_element_a(cls, element: ifcopenshell.entity_instance, ifc_class: str) -> bool: