system.assign_system - support batching #4474

This commit is contained in:
Andrej730
2024-04-11 15:54:06 +05:00
parent 3d243b5eee
commit 6b48e8b4b9
13 changed files with 119 additions and 48 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ def disable_editing_system(system):
def assign_system(ifc, system=None, product=None):
ifc.run("system.assign_system", product=product, system=system)
ifc.run("system.assign_system", products=[product], system=system)
def unassign_system(ifc, system=None, product=None):
+1 -1
View File
@@ -74,7 +74,7 @@ class TestDisableEditingSystem:
class TestAssignSystem:
def test_run(self, ifc):
ifc.run("system.assign_system", product="product", system="system").should_be_called()
ifc.run("system.assign_system", products=["product"], system="system").should_be_called()
subject.assign_system(ifc, system="system", product="product")
+1 -1
View File
@@ -262,7 +262,7 @@ class TestSelectSystemProducts(NewFile):
tool.Ifc().set(ifc)
element = ifcopenshell.api.run("root.create_entity", ifc, ifc_class="IfcPump")
system = ifcopenshell.api.run("system.add_system", ifc, ifc_class="IfcSystem")
ifcopenshell.api.run("system.assign_system", ifc, product=element, system=system)
ifcopenshell.api.run("system.assign_system", ifc, products=[element], system=system)
obj = bpy.data.objects.new("Object", None)
bpy.context.scene.collection.objects.link(obj)
tool.Ifc.link(element, obj)