From 6750dd927cb89811a87b9326e83bad6592c19139 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 17 Nov 2023 12:30:34 +0500 Subject: [PATCH] minor fixes - error in settings poll message for bim.assign_selected_as_product - test that drawing.assign_product won't create new assignments for the same product --- src/blenderbim/blenderbim/bim/module/drawing/operator.py | 2 +- src/ifcopenshell-python/test/api/drawing/test_assign_product.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/module/drawing/operator.py b/src/blenderbim/blenderbim/bim/module/drawing/operator.py index a8b43324f5..c0598accde 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/operator.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/operator.py @@ -2292,7 +2292,7 @@ class AssignSelectedObjectAsProduct(bpy.types.Operator): @classmethod def poll(cls, context): if len(context.selected_objects) != 2: - cls.poll_message_set({"ERROR"}, "2 objects need to be selected") + cls.poll_message_set("2 objects need to be selected") return False return True diff --git a/src/ifcopenshell-python/test/api/drawing/test_assign_product.py b/src/ifcopenshell-python/test/api/drawing/test_assign_product.py index 24195f1a07..78b10e5d76 100644 --- a/src/ifcopenshell-python/test/api/drawing/test_assign_product.py +++ b/src/ifcopenshell-python/test/api/drawing/test_assign_product.py @@ -35,4 +35,5 @@ class TestAssignProduct(test.bootstrap.IFC4): label = self.file.createIfcAnnotation() ifcopenshell.api.run("drawing.assign_product", self.file, relating_product=wall, related_object=label) ifcopenshell.api.run("drawing.assign_product", self.file, relating_product=wall, related_object=label) + assert len(wall.ReferencedBy) == 1 assert wall.ReferencedBy[0].RelatedObjects == (label,)