library.unassign_reference - support batching #4474

This commit is contained in:
Andrej730
2024-04-15 16:28:43 +05:00
parent 81dcad6a14
commit 1f605484d9
6 changed files with 59 additions and 25 deletions
@@ -246,3 +246,11 @@ class TestTemporarySupportForDeprecatedAPIArguments(test.bootstrap.IFC4):
assert reference.LibraryRefForObjects[0].RelatedObjects == (product,)
ifcopenshell.api.run("library.assign_reference", self.file, product=product2, reference=reference)
assert set(reference.LibraryRefForObjects[0].RelatedObjects) == set((product, product2))
@deprecation_check
def test_unassigning_a_reference(self):
reference = self.file.createIfcLibraryReference()
product = self.file.createIfcWall()
ifcopenshell.api.run("library.assign_reference", self.file, products=[product], reference=reference)
ifcopenshell.api.run("library.unassign_reference", self.file, product=product, reference=reference)
assert len(self.file.by_type("IfcRelAssociatesLibrary")) == 0