From ec97b04bdeadd748955de1b14adb46cc2b86d490 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 19 Oct 2023 10:49:39 +0500 Subject: [PATCH] Fixed #3907 after dd7a6a80e --- src/blenderbim/blenderbim/tool/drawing.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/blenderbim/blenderbim/tool/drawing.py b/src/blenderbim/blenderbim/tool/drawing.py index 09a4011c7b..9b568bb365 100644 --- a/src/blenderbim/blenderbim/tool/drawing.py +++ b/src/blenderbim/blenderbim/tool/drawing.py @@ -1647,13 +1647,15 @@ class Drawing(blenderbim.core.tool.Drawing): for element in filtered_elements: obj = tool.Ifc.get_object(element) - subcontext = tool.Geometry.get_active_representation(obj).ContextOfItems - current_representation_subcontext = tool.Geometry.get_subcontext_parameters(subcontext) + current_representation = tool.Geometry.get_active_representation(obj) + if current_representation: + subcontext = current_representation.ContextOfItems + current_representation_subcontext = tool.Geometry.get_subcontext_parameters(subcontext) for subcontext in subcontexts: # prioritize already active representation if it matches the subcontext # (element could have multiple representations in the same subcontext) - if subcontext == current_representation_subcontext: + if current_representation and subcontext == current_representation_subcontext: break priority_representation = ifcopenshell.util.representation.get_representation(element, *subcontext) if priority_representation: