From 4a1422d2926a0f31005c970adebf0e31ed91459f Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 10 Jan 2025 14:13:24 +1100 Subject: [PATCH] New annotations should not go into the unsorted collection --- src/bonsai/bonsai/core/drawing.py | 2 +- src/bonsai/bonsai/tool/collector.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bonsai/bonsai/core/drawing.py b/src/bonsai/bonsai/core/drawing.py index 0a1ec7d5eb..9dd4490e98 100644 --- a/src/bonsai/bonsai/core/drawing.py +++ b/src/bonsai/bonsai/core/drawing.py @@ -425,7 +425,7 @@ def add_annotation( ifc_representation_class=drawing_tool.get_ifc_representation_class(object_type), ) ifc.run("group.assign_group", group=drawing_tool.get_drawing_group(drawing), products=[element]) - collector.assign(obj) + collector.assign(obj, should_clean_users_collection=True) drawing_tool.enable_editing(obj) diff --git a/src/bonsai/bonsai/tool/collector.py b/src/bonsai/bonsai/tool/collector.py index 2754f708ad..e6400a3076 100644 --- a/src/bonsai/bonsai/tool/collector.py +++ b/src/bonsai/bonsai/tool/collector.py @@ -31,11 +31,11 @@ class Collector(bonsai.core.tool.Collector): for users_collection in obj.users_collection: if obj.BIMObjectProperties.collection == users_collection: continue - # Users are free to user extra collections for their own + # Users are free to use extra collections for their own # purposes except for the reserved keyword "Ifc" and # "Collection" (which is the default collection that comes with - # a Blender session) - if "Ifc" in users_collection.name or users_collection.name == "Collection": + # a Blender session) and "Unsorted" (our special collection). + if "Ifc" in users_collection.name or users_collection.name in ("Collection", "Unsorted"): users_collection.objects.unlink(obj) element = tool.Ifc.get_entity(obj)