From 960610325fdc43fadc04094f05268e30d90f79ad Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 6 Nov 2021 17:36:47 +1100 Subject: [PATCH] Fix interface bug where representations assigned directly to a context aren't shown --- .../blenderbim/bim/module/geometry/data.py | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/geometry/data.py b/src/blenderbim/blenderbim/bim/module/geometry/data.py index 74413ccb3c..660f0129f6 100644 --- a/src/blenderbim/blenderbim/bim/module/geometry/data.py +++ b/src/blenderbim/blenderbim/bim/module/geometry/data.py @@ -49,15 +49,17 @@ class RepresentationsData: if representation_type == "MappedRepresentation": representation_type = representation.Items[0].MappingSource.MappedRepresentation.RepresentationType representation_type += "*" - results.append( - { - "id": representation.id(), - "ContextType": representation.ContextOfItems.ContextType, - "ContextIdentifier": representation.ContextOfItems.ContextIdentifier, - "TargetView": representation.ContextOfItems.TargetView, - "RepresentationType": representation_type, - } - ) + data = { + "id": representation.id(), + "ContextType": representation.ContextOfItems.ContextType or "", + "ContextIdentifier": "", + "TargetView": "", + "RepresentationType": representation_type or "", + } + if representation.ContextOfItems.is_a("IfcGeometricRepresentationSubContext"): + data["ContextIdentifier"] = representation.ContextOfItems.ContextIdentifier or "" + data["TargetView"] = representation.ContextOfItems.TargetView or "" + results.append(data) return results