mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
Refactor and re-use common spatial_tool.select_products
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user