Arch: importIFCHelper: Fix crash on unsupported entity

When getCurveSet() is called on an unsupported entity, it runs into a
NameError exception because elts is not defined. Instead print a message
and return gracefully.

This is in line with overall behaviour of the importer: Ignore
unsupported elements instead of thowing errors.
This commit is contained in:
Harald Geyer
2020-05-25 22:59:19 +02:00
committed by Yorik van Havre
parent d8f770989c
commit 6008cbcd13

View File

@@ -634,6 +634,10 @@ def get2DShape(representation,scaling=1000):
elts = ent.Elements
elif ent.is_a() in ["IfcLine","IfcPolyline","IfcCircle","IfcTrimmedCurve","IfcRectangleProfileDef"]:
elts = [ent]
else:
print("getCurveSet: unhandled entity: ", ent)
return []
for el in elts:
if el.is_a("IfcPolyline"):
result.append(getPolyline(el))