diff --git a/src/blenderbim/blenderbim/bim/export_ifc.py b/src/blenderbim/blenderbim/bim/export_ifc.py index 4e9f75f83b..7b849b6fc3 100644 --- a/src/blenderbim/blenderbim/bim/export_ifc.py +++ b/src/blenderbim/blenderbim/bim/export_ifc.py @@ -5,12 +5,11 @@ import numpy as np import datetime import zipfile import tempfile -import ifcopenshell -import ifcopenshell.util.placement -import ifcopenshell.api -from ifcopenshell.api.spatial.data import Data as SpatialData -from blenderbim.bim.ifc import IfcStore import addon_utils +import ifcopenshell +import ifcopenshell.api +import ifcopenshell.util.placement +from blenderbim.bim.ifc import IfcStore class IfcExporter: @@ -77,8 +76,6 @@ class IfcExporter: if self.should_delete(obj): to_delete.append(ifc_definition_id) - SpatialData.purge() - for ifc_definition_id in to_delete: product = self.file.by_id(ifc_definition_id) IfcStore.unlink_element(product) diff --git a/src/blenderbim/blenderbim/bim/module/pset/operator.py b/src/blenderbim/blenderbim/bim/module/pset/operator.py index 58ec1d64fd..869af7db35 100644 --- a/src/blenderbim/blenderbim/bim/module/pset/operator.py +++ b/src/blenderbim/blenderbim/bim/module/pset/operator.py @@ -7,6 +7,7 @@ import ifcopenshell.util.attribute import blenderbim.bim.schema from blenderbim.bim.ifc import IfcStore from ifcopenshell.api.pset.data import Data +from ifcopenshell.api.cost.data import Data as CostData from blenderbim.bim.module.pset.qto_calculator import QtoCalculator @@ -211,6 +212,7 @@ class EditPset(bpy.types.Operator): "properties": properties, }, ) + CostData.purge() Data.load(IfcStore.get_file(), oprops.ifc_definition_id) bpy.ops.bim.disable_pset_editing(obj=self.obj, obj_type=self.obj_type) return {"FINISHED"} diff --git a/src/blenderbim/blenderbim/bim/operator.py b/src/blenderbim/blenderbim/bim/operator.py index 506d805a9c..7278897ab8 100644 --- a/src/blenderbim/blenderbim/bim/operator.py +++ b/src/blenderbim/blenderbim/bim/operator.py @@ -6,6 +6,7 @@ import tempfile import logging import webbrowser import ifcopenshell +import blenderbim.bim.handler from . import export_ifc from . import import_ifc from . import schema @@ -77,6 +78,7 @@ class ExportIFC(bpy.types.Operator): scene.BIMProperties.ifc_file = output_file if bpy.data.is_saved and bpy.data.is_dirty and bpy.data.filepath: bpy.ops.wm.save_mainfile(filepath=bpy.data.filepath) + blenderbim.bim.handler.purge_module_data() return {"FINISHED"}