From 7691e22c599fb8bcef8a286e3dba8867ca4037b4 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 7 Jan 2016 12:09:17 -0200 Subject: [PATCH] Arch: handle ifcopenshell error when shape is not available --- src/Mod/Arch/importIFC.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index ddaea9b58..e49c622e1 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -444,8 +444,13 @@ def insert(filename,docname,skip=[],only=[],root=None): # detect if this object is sharing its shape clone = None store = None - if product.Representation and MERGE_MODE_ARCH == 0 and archobj: - for s in product.Representation.Representations: + prepr = None + try: + prepr = product.Representation + except: + if DEBUG: print " ERROR unable to get object representation", + if prepr and (MERGE_MODE_ARCH == 0) and archobj: + for s in prepr.Representations: if s.RepresentationIdentifier.upper() == "BODY": if s.Items[0].is_a("IfcMappedItem"): bid = s.Items[0].MappingSource.id()