Refactor and re-use common spatial_tool.select_products

This commit is contained in:
Sigma Dimensions
2023-06-12 15:21:33 +01:00
parent a7faa3ec3e
commit 0959a7f6a3
16 changed files with 43 additions and 72 deletions
+12
View File
@@ -257,3 +257,15 @@ class TestSetRelativeObjectMatrix(NewFile):
matrix[0][3] = 1
subject.set_relative_object_matrix(obj, relative_obj, matrix)
assert obj.matrix_world[0][3] == 2
class TestSelectProducts(NewFile):
def test_select_products(self):
ifc = ifcopenshell.file()
tool.Ifc.set(ifc)
product = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcWall")
obj = bpy.data.objects.new("Object", None)
bpy.context.scene.collection.objects.link(obj)
tool.Ifc.link(product, obj)
subject.select_products([product])
assert obj in bpy.context.selected_objects