mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
First attempt at ripping out agnostic code into ifcopenshell.api namespace. See #1399.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
class Data:
|
||||
products = {}
|
||||
|
||||
@classmethod
|
||||
def purge(cls):
|
||||
cls.products = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls, file, product_id):
|
||||
if not file:
|
||||
return
|
||||
product = file.by_id(product_id)
|
||||
cls.products[product_id] = {
|
||||
"type": product.is_a(),
|
||||
"PredefinedType": product.PredefinedType if hasattr(product, "PredefinedType") else None,
|
||||
"ObjectType": product.ObjectType if hasattr(product, "ObjectType") else None
|
||||
}
|
||||
Reference in New Issue
Block a user