From 04aad216bac871869356d48c2dba6cb3feeb7dcd Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 7 Feb 2021 11:44:14 +1100 Subject: [PATCH] Type representation maps are now shown in the IFC Representations UI panel --- .../blenderbim/bim/module/geometry/data.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/data.py b/src/ifcblenderexport/blenderbim/bim/module/geometry/data.py index 5eaaba6cf8..6957e9f2e6 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/geometry/data.py +++ b/src/ifcblenderexport/blenderbim/bim/module/geometry/data.py @@ -17,9 +17,12 @@ class Data: return cls.products[product_id] = [] product = file.by_id(product_id) - if not hasattr(product, "Representation") or not product.Representation: - return - for representation in product.Representation.Representations: + representations = [] + if product.is_a("IfcProduct"): + representations = product.Representation.Representations + elif product.is_a("IfcTypeProduct"): + representations = [rm.MappedRepresentation for rm in product.RepresentationMaps] + for representation in representations: c = representation.ContextOfItems rep_id = int(representation.id()) cls.representations[rep_id] = {