mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
24 lines
652 B
Python
24 lines
652 B
Python
import ifcopenshell.api
|
|
|
|
|
|
class Data:
|
|
is_loaded = False
|
|
resources = {}
|
|
|
|
@classmethod
|
|
def purge(cls):
|
|
cls.resources = {}
|
|
|
|
@classmethod
|
|
def load(cls, file):
|
|
cls.resources = {}
|
|
for resource in file.by_type("IfcResource"):
|
|
data = resource.get_info()
|
|
del data["OwnerHistory"]
|
|
data["RelatedObjects"] = []
|
|
for rel in resource.IsNestedBy:
|
|
[data["RelatedObjects"].append(o.id()) for o in rel.RelatedObjects if o.is_a("IfcCrewResource") or o.is_a("IfcsubcontractResource")]
|
|
cls.resources[resource.id()] = data
|
|
|
|
cls.is_loaded=True
|