mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
25 lines
723 B
Python
25 lines
723 B
Python
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
|