New annotations should not go into the unsorted collection

This commit is contained in:
Dion Moult
2025-01-10 14:13:24 +11:00
parent 1e448cb170
commit 4a1422d292
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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)