mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Fix #1288 - error when importing consecutive files.
This commit is contained in:
@@ -15,6 +15,16 @@ def loadIfcStore(scene):
|
|||||||
{k: bpy.data.objects.get(v) for k, v in json.loads(props.guid_map).items()} if props.id_map else {}
|
{k: bpy.data.objects.get(v) for k, v in json.loads(props.guid_map).items()} if props.id_map else {}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Purge data cache
|
||||||
|
from blenderbim.bim import modules
|
||||||
|
for module in modules.values():
|
||||||
|
if not module:
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
getattr(getattr(module, 'data'), 'Data').purge()
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
@persistent
|
@persistent
|
||||||
def storeIdMap(scene):
|
def storeIdMap(scene):
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ from blenderbim.bim.ifc import IfcStore
|
|||||||
class Data:
|
class Data:
|
||||||
products = {}
|
products = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.products = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id):
|
def load(cls, product_id):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ from blenderbim.bim.ifc import IfcStore
|
|||||||
class Data:
|
class Data:
|
||||||
products = {}
|
products = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.products = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id):
|
def load(cls, product_id):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -12,6 +12,16 @@ class Data:
|
|||||||
library_classifications = {}
|
library_classifications = {}
|
||||||
library_references = {}
|
library_references = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.is_loaded = False
|
||||||
|
cls.products = {}
|
||||||
|
cls.classifications = {}
|
||||||
|
cls.references = {}
|
||||||
|
cls.library_file = None
|
||||||
|
cls.library_classifications = {}
|
||||||
|
cls.library_references = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id=None):
|
def load(cls, product_id=None):
|
||||||
cls._file = IfcStore.get_file()
|
cls._file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ class Data:
|
|||||||
products = {}
|
products = {}
|
||||||
objectives = {}
|
objectives = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.is_loaded = False
|
||||||
|
cls.products = {}
|
||||||
|
cls.objectives = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id=None):
|
def load(cls, product_id=None):
|
||||||
cls._file = IfcStore.get_file()
|
cls._file = IfcStore.get_file()
|
||||||
@@ -28,7 +34,7 @@ class Data:
|
|||||||
for association in product.HasAssociations:
|
for association in product.HasAssociations:
|
||||||
if association.is_a("IfcRelAssociatesConstraint"):
|
if association.is_a("IfcRelAssociatesConstraint"):
|
||||||
if not association.RelatingConstraint.is_a("IfcObjective"):
|
if not association.RelatingConstraint.is_a("IfcObjective"):
|
||||||
continue # not yet implemented
|
continue # not yet implemented
|
||||||
cls.products[product_id].append(association.RelatingConstraint.id())
|
cls.products[product_id].append(association.RelatingConstraint.id())
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ class Data:
|
|||||||
is_loaded = False
|
is_loaded = False
|
||||||
contexts = {}
|
contexts = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.is_loaded = False
|
||||||
|
cls.contexts = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls):
|
def load(cls):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ class Data:
|
|||||||
references = {}
|
references = {}
|
||||||
information = {}
|
information = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.is_loaded = False
|
||||||
|
cls.products = {}
|
||||||
|
cls.references = {}
|
||||||
|
cls.information = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id=None):
|
def load(cls, product_id=None):
|
||||||
cls._file = IfcStore.get_file()
|
cls._file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ class Data:
|
|||||||
products = {}
|
products = {}
|
||||||
representations = {}
|
representations = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.products = False
|
||||||
|
cls.representations = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id):
|
def load(cls, product_id):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ class Data:
|
|||||||
map_conversion = {}
|
map_conversion = {}
|
||||||
projected_crs = {}
|
projected_crs = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.is_loaded = False
|
||||||
|
cls.map_conversion = {}
|
||||||
|
cls.projected_crs = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls):
|
def load(cls):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ class Data:
|
|||||||
items = {}
|
items = {}
|
||||||
layers = {}
|
layers = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.is_loaded = False
|
||||||
|
cls.items = {}
|
||||||
|
cls.layers = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, item_id=None):
|
def load(cls, item_id=None):
|
||||||
cls._file = IfcStore.get_file()
|
cls._file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -15,6 +15,20 @@ class Data:
|
|||||||
products = {}
|
products = {}
|
||||||
_file = None
|
_file = None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.is_loaded = False
|
||||||
|
cls.materials = {}
|
||||||
|
cls.constituent_sets = {}
|
||||||
|
cls.constituents = {}
|
||||||
|
cls.layer_sets = {}
|
||||||
|
cls.layers = {}
|
||||||
|
cls.profile_sets = {}
|
||||||
|
cls.profiles = {}
|
||||||
|
cls.lists = {}
|
||||||
|
cls.products = {}
|
||||||
|
cls._file = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id=None):
|
def load(cls, product_id=None):
|
||||||
cls._file = IfcStore.get_file()
|
cls._file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -8,6 +8,14 @@ class Data:
|
|||||||
addresses = {}
|
addresses = {}
|
||||||
roles = {}
|
roles = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.is_loaded = False
|
||||||
|
cls.people = {}
|
||||||
|
cls.organisations = {}
|
||||||
|
cls.addresses = {}
|
||||||
|
cls.roles = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls):
|
def load(cls):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -8,6 +8,12 @@ class Data:
|
|||||||
psets = {}
|
psets = {}
|
||||||
qtos = {}
|
qtos = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.products = {}
|
||||||
|
cls.psets = {}
|
||||||
|
cls.qtos = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id):
|
def load(cls, product_id):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ from blenderbim.bim.ifc import IfcStore
|
|||||||
class Data:
|
class Data:
|
||||||
products = {}
|
products = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.products = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id):
|
def load(cls, product_id):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ from blenderbim.bim.ifc import IfcStore
|
|||||||
class Data:
|
class Data:
|
||||||
products = {}
|
products = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.products = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id):
|
def load(cls, product_id):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ from blenderbim.bim.ifc import IfcStore
|
|||||||
class Data:
|
class Data:
|
||||||
products = {}
|
products = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.products = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id):
|
def load(cls, product_id):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ class Data:
|
|||||||
is_loaded = False
|
is_loaded = False
|
||||||
units = {}
|
units = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.is_loaded = False
|
||||||
|
cls.units = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls):
|
def load(cls):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ class Data:
|
|||||||
openings = {}
|
openings = {}
|
||||||
fillings = {}
|
fillings = {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def purge(cls):
|
||||||
|
cls.products = {}
|
||||||
|
cls.openings = {}
|
||||||
|
cls.fillings = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, product_id):
|
def load(cls, product_id):
|
||||||
file = IfcStore.get_file()
|
file = IfcStore.get_file()
|
||||||
|
|||||||
Reference in New Issue
Block a user