From 0d5110b7afeb00ca2ff50c37fe9b9a6e57096afb Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 18 May 2021 16:42:41 +1000 Subject: [PATCH] Fix bug where you were unable to remove a representation --- .../ifcopenshell/api/geometry/unassign_representation.py | 2 +- src/ifcopenshell-python/ifcopenshell/api/type/assign_type.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/unassign_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/unassign_representation.py index 579b0c0a7c..185fda0a01 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/unassign_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/unassign_representation.py @@ -53,4 +53,4 @@ class Usecase: for item in mapped_representations: self.unassign_product_representation(item["product"], item["representation"]) for representation in just_representations: - ifcopenshell.api.run("owner.remove_representation", self.file, **{"representation": representation}) + ifcopenshell.api.run("geometry.remove_representation", self.file, **{"representation": representation}) diff --git a/src/ifcopenshell-python/ifcopenshell/api/type/assign_type.py b/src/ifcopenshell-python/ifcopenshell/api/type/assign_type.py index 158a7087b2..38f4c84449 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/type/assign_type.py +++ b/src/ifcopenshell-python/ifcopenshell/api/type/assign_type.py @@ -71,11 +71,11 @@ class Usecase: ifcopenshell.api.run("geometry.remove_representation", self.file, **{"representation": representation}) for representation_map in self.settings["relating_type"].RepresentationMaps: representation = representation_map.MappedRepresentation - result = ifcopenshell.api.run( + mapped_representation = ifcopenshell.api.run( "geometry.map_representation", self.file, **{"representation": representation} ) ifcopenshell.api.run( "geometry.assign_representation", self.file, - **{"product": self.settings["related_object"], "representation": result} + **{"product": self.settings["related_object"], "representation": mapped_representation} )