From ac64d0c400ba4743f16947bca979e691b3377b61 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 16 Apr 2024 08:06:10 +1000 Subject: [PATCH] Fix #3581. Invalid new document references. --- .../ifcopenshell/api/document/add_reference.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/document/add_reference.py b/src/ifcopenshell-python/ifcopenshell/api/document/add_reference.py index 39cdb109d6..bcec5da606 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/document/add_reference.py +++ b/src/ifcopenshell-python/ifcopenshell/api/document/add_reference.py @@ -69,10 +69,12 @@ class Usecase: def execute(self) -> ifcopenshell.entity_instance: if self.file.schema == "IFC2X3": - reference = self.file.create_entity("IfcDocumentReference") + reference = self.file.create_entity("IfcDocumentReference", ItemReference="X") if self.settings["information"]: references = list(self.settings["information"].DocumentReferences or []) references.append(reference) self.settings["information"].DocumentReferences = references return reference - return self.file.create_entity("IfcDocumentReference", ReferencedDocument=self.settings["information"]) + return self.file.create_entity( + "IfcDocumentReference", ReferencedDocument=self.settings["information"], Identification="X" + )