diff --git a/src/ifcopenshell-python/ifcopenshell/file.py b/src/ifcopenshell-python/ifcopenshell/file.py index 5f9fbc7a3d..e4935a611d 100644 --- a/src/ifcopenshell-python/ifcopenshell/file.py +++ b/src/ifcopenshell-python/ifcopenshell/file.py @@ -290,9 +290,6 @@ class file(object): if attrs: self.transaction = transaction - if self.transaction: - self.transaction.store_create(e) - # Once the values are populated add the instance # to the file. self.wrapped_data.add(e.wrapped_data, eid) @@ -302,6 +299,9 @@ class file(object): # the owner. e.wrapped_data.this.disown() + if self.transaction: + self.transaction.store_create(e) + return e def __getattr__(self, attr):