From 9954e073fa0e994ee9a0823816fd91115d4f6a83 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 15 Apr 2024 16:57:37 +0500 Subject: [PATCH] constraint.assign_constraint to handle owner history --- .../ifcopenshell/api/constraint/assign_constraint.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/constraint/assign_constraint.py b/src/ifcopenshell-python/ifcopenshell/api/constraint/assign_constraint.py index 1d77a7bb74..e680f129f5 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/constraint/assign_constraint.py +++ b/src/ifcopenshell-python/ifcopenshell/api/constraint/assign_constraint.py @@ -17,6 +17,7 @@ # along with IfcOpenShell. If not, see . import ifcopenshell +import ifcopenshell.api class Usecase: @@ -50,6 +51,7 @@ class Usecase: related_objects = set(rel.RelatedObjects) if rel.RelatedObjects else set() related_objects.add(self.settings["product"]) rel.RelatedObjects = list(related_objects) + ifcopenshell.api.run("owner.update_owner_history", self.file, **{"element": rel}) return rel def get_constraint_rel(self): @@ -60,7 +62,7 @@ class Usecase: "IfcRelAssociatesConstraint", **{ "GlobalId": ifcopenshell.guid.new(), - # TODO: owner history + "OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file), "RelatingConstraint": self.settings["constraint"], } )