spatial.dereference_structure - support batching #4474

This commit is contained in:
Andrej730
2024-04-16 10:59:50 +05:00
parent 8ac0d22a95
commit f1f8b3da6b
6 changed files with 58 additions and 27 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ def dereference_structure(
element: Optional[ifcopenshell.entity_instance] = None,
) -> None:
if spatial.can_reference(structure, element):
return ifc.run("spatial.dereference_structure", product=element, relating_structure=structure)
return ifc.run("spatial.dereference_structure", products=[element], relating_structure=structure)
def assign_container(
+1 -1
View File
@@ -30,7 +30,7 @@ class TestReferenceStructure:
class TestDereferenceStructure:
def test_run(self, ifc, spatial):
spatial.can_reference("structure", "element").should_be_called().will_return(True)
ifc.run("spatial.dereference_structure", product="element", relating_structure="structure").should_be_called()
ifc.run("spatial.dereference_structure", products=["element"], relating_structure="structure").should_be_called()
subject.dereference_structure(ifc, spatial, structure="structure", element="element")