From ec62d8fbb95f7c3679be834e3c6e1e4bc46733fe Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 4 Apr 2021 09:02:14 +1000 Subject: [PATCH] Fix bug where assigning a spatial container didn't update the object placement tree --- .../ifcopenshell/api/spatial/assign_container.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/api/spatial/assign_container.py b/src/ifcopenshell-python/ifcopenshell/api/spatial/assign_container.py index 0312748c45..fe46877cae 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/spatial/assign_container.py +++ b/src/ifcopenshell-python/ifcopenshell/api/spatial/assign_container.py @@ -1,5 +1,6 @@ import ifcopenshell import ifcopenshell.api +import ifcopenshell.util.placement class Usecase: @@ -43,3 +44,11 @@ class Usecase: "RelatingStructure": self.settings["relating_structure"], } ) + + if getattr(self.settings["product"], "ObjectPlacement", None): + ifcopenshell.api.run( + "geometry.edit_object_placement", + self.file, + product=self.settings["product"], + matrix=ifcopenshell.util.placement.get_local_placement(self.settings["product"].ObjectPlacement), + )