Fix bug where you were unable to remove a representation

This commit is contained in:
Dion Moult
2021-05-18 16:42:41 +10:00
parent de873461e1
commit 0d5110b7af
2 changed files with 3 additions and 3 deletions
@@ -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})
@@ -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}
)