mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
system.assign_system - support batching #4474
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user