#2106. Fix bug where geometry cache was not cleared when openings were changed

This commit is contained in:
Dion Moult
2022-03-26 20:38:16 +11:00
parent baf75f552e
commit 3b0429ace9
2 changed files with 3 additions and 0 deletions
@@ -156,6 +156,7 @@ class UpdateRepresentation(bpy.types.Operator):
def update_obj_mesh_representation(self, context, obj):
product = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)
tool.Geometry.clear_cache(product)
if product.is_a("IfcGridAxis"):
ifcopenshell.api.run("grid.create_axis_curve", self.file, **{"axis_curve": obj, "grid_axis": product})
@@ -44,6 +44,7 @@ class AddOpening(bpy.types.Operator):
if not element_id:
return {"FINISHED"}
element = self.file.by_id(element_id)
tool.Geometry.clear_cache(element)
if element.is_a("IfcOpeningElement"):
self.report({"WARNING"}, "An IfcOpeningElement can't be voided")
return {"FINISHED"}
@@ -132,6 +133,7 @@ class RemoveOpening(bpy.types.Operator):
should_sync_changes_first=False,
)
tool.Geometry.clear_cache(tool.Ifc.get_entity(obj))
Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id)
return {"FINISHED"}