mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 21:12:07 +00:00
WIP refactor mesh UI into geometry module and minor fixes. See #1222.
This commit is contained in:
@@ -3,19 +3,21 @@ from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
class Data:
|
||||
products = {}
|
||||
representations = {}
|
||||
|
||||
@classmethod
|
||||
def load(cls, product_id):
|
||||
file = IfcStore.get_file()
|
||||
if not file:
|
||||
return
|
||||
cls.products[product_id] = {"Representations": {}}
|
||||
cls.products[product_id] = []
|
||||
product = file.by_id(product_id)
|
||||
if not product.Representation:
|
||||
return
|
||||
for representation in product.Representation.Representations:
|
||||
c = representation.ContextOfItems
|
||||
cls.products[product_id]["Representations"][int(representation.id())] = {
|
||||
rep_id = int(representation.id())
|
||||
cls.representations[rep_id] = {
|
||||
"RepresentationIdentifier": representation.RepresentationIdentifier,
|
||||
"RepresentationType": representation.RepresentationType,
|
||||
"ContextOfItems": {
|
||||
@@ -24,3 +26,4 @@ class Data:
|
||||
"TargetView": c.TargetView if c.is_a("IfcGeometricRepresentationSubContext") else "",
|
||||
}
|
||||
}
|
||||
cls.products[product_id].append(rep_id)
|
||||
|
||||
Reference in New Issue
Block a user