Files
IfcOpenShell/src/ifcopenshell-python/ifcopenshell/api/system/data.py
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
723 B
Python
Raw Normal View History

class Data:
is_loaded = False
products = {}
systems = {}
@classmethod
def purge(cls):
cls.is_loaded = False
cls.products = {}
cls.systems = {}
@classmethod
def load(cls, file):
cls.products = {}
cls.systems = {}
for system in file.by_type("IfcSystem", include_subtypes=False):
if system.IsGroupedBy:
for rel in system.IsGroupedBy:
for product in rel.RelatedObjects:
cls.products.setdefault(product.id(), []).append(system.id())
data = system.get_info()
del data["OwnerHistory"]
cls.systems[system.id()] = data
cls.is_loaded=True