From 90b40ff0dc0a8c6d61b90d0ee0ed2d6184983fdd Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 2 Oct 2023 16:55:38 +0500 Subject: [PATCH] Getting drawing group more precisely Previously it was conflicting with other possible groups assigned to the object. It's now even more important since we're actively using groups to save search queries. Example error caused by this issue - during drawing activation if you had 2 IfcGroups on the drawing element: draiwng's IfcGroup RelatedObjects attribute was updated, then inverse attrtibute `drawing.HasAssignments` order was updated too (DRAWING IfcGroup now would be positioned second after IfcGroup for search query) and it was leading to errors during filtering current drawing annotations --- src/blenderbim/blenderbim/tool/drawing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/tool/drawing.py b/src/blenderbim/blenderbim/tool/drawing.py index 6d461cefc5..ae75535699 100644 --- a/src/blenderbim/blenderbim/tool/drawing.py +++ b/src/blenderbim/blenderbim/tool/drawing.py @@ -416,7 +416,7 @@ class Drawing(blenderbim.core.tool.Drawing): @classmethod def get_drawing_group(cls, drawing): for rel in drawing.HasAssignments or []: - if rel.is_a("IfcRelAssignsToGroup"): + if rel.is_a("IfcRelAssignsToGroup") and rel.RelatingGroup.ObjectType == "DRAWING": return rel.RelatingGroup @classmethod