From e06684e2741ad1e7df3b5ce9ed7aa88c0e1af7dd Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 24 Feb 2025 16:44:54 +0500 Subject: [PATCH] Comment out outdated code #6200 --- .../bonsai/bim/module/drawing/annotation.py | 20 ++++++++++--------- src/bonsai/bonsai/core/drawing.py | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/drawing/annotation.py b/src/bonsai/bonsai/bim/module/drawing/annotation.py index a04360f5ed..9f02989384 100644 --- a/src/bonsai/bonsai/bim/module/drawing/annotation.py +++ b/src/bonsai/bonsai/bim/module/drawing/annotation.py @@ -150,15 +150,17 @@ class Annotator: collection.objects.link(obj) return obj - if object_type != "ANGLE": - for obj in collection.objects: - element = tool.Ifc.get_entity(obj) - if ( - element - and ifcopenshell.util.element.get_predefined_type(element) == object_type - and obj.type == data_type.upper() - ): - return obj + # TODO: remove as outdated? + # Is reusing the same objects preventing the creation of new annotations. + # if object_type != "ANGLE": + # for obj in collection.objects: + # element = tool.Ifc.get_entity(obj) + # if ( + # element + # and ifcopenshell.util.element.get_predefined_type(element) == object_type + # and obj.type == data_type.upper() + # ): + # return obj if data_type == "mesh": data = bpy.data.meshes.new(object_type) diff --git a/src/bonsai/bonsai/core/drawing.py b/src/bonsai/bonsai/core/drawing.py index e5ae3cd493..c01b70bd55 100644 --- a/src/bonsai/bonsai/core/drawing.py +++ b/src/bonsai/bonsai/core/drawing.py @@ -417,6 +417,7 @@ def add_annotation( drawing_tool.show_decorations() obj = drawing_tool.create_annotation_object(drawing, object_type) element = ifc.get_entity(obj) + # TODO: element is never None? if not element: relating_type_rep = drawing_tool.get_annotation_representation(relating_type) if relating_type else None element = drawing_tool.run_root_assign_class(