Fix support for document references in IFC2X3

This commit is contained in:
Dion Moult
2022-10-19 20:15:51 +11:00
parent 7f278fbde4
commit 16b05d9981
3 changed files with 35 additions and 8 deletions
@@ -33,3 +33,18 @@ class TestAddReference(test.bootstrap.IFC4):
assert element.is_a("IfcDocumentReference")
assert len(self.file.by_type("IfcDocumentReference")) == 1
assert element.ReferencedDocument == information
class TestAddReferenceIFC2X3(test.bootstrap.IFC2X3):
def test_adding_a_reference(self):
element = ifcopenshell.api.run("document.add_reference", self.file, information=None)
assert element.is_a("IfcDocumentReference")
assert len(self.file.by_type("IfcDocumentReference")) == 1
def test_adding_a_reference_to_an_information(self):
self.file.createIfcProject()
information = ifcopenshell.api.run("document.add_information", self.file, parent=None)
element = ifcopenshell.api.run("document.add_reference", self.file, information=information)
assert element.is_a("IfcDocumentReference")
assert len(self.file.by_type("IfcDocumentReference")) == 1
assert element.ReferenceToDocument[0] == information