From 9de5f54dae200598c027a819953433fd550bdcf9 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 3 Jul 2020 13:54:26 +0200 Subject: [PATCH] Arch: IFC, fix import break on a IfcAxis2Placement2D --- src/Mod/Arch/importIFCHelper.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/importIFCHelper.py b/src/Mod/Arch/importIFCHelper.py index 45ad040422..f01f7848e2 100644 --- a/src/Mod/Arch/importIFCHelper.py +++ b/src/Mod/Arch/importIFCHelper.py @@ -567,6 +567,8 @@ def getPlacement(entity,scaling=1000): loc = getVector(entity.Location,scaling) if loc: pl.move(loc) + elif entity.is_a("IfcAxis2Placement2D"): + print("not implemented IfcAxis2Placement2D, ", end="") elif entity.is_a("IfcLocalPlacement"): pl = getPlacement(entity.PlacementRelTo,1) # original placement relpl = getPlacement(entity.RelativePlacement,1) # relative transf @@ -732,8 +734,10 @@ def get2DShape(representation,scaling=1000): else: result = preresult elif item.is_a("IfcTextLiteral"): - t = Draft.makeText([item.Literal],point=getPlacement(item.Placement,scaling).Base) - return t # dirty hack... Object creation should not be done here + pl = getPlacement(item.Placement, scaling) + if pl: + t = Draft.makeText([item.Literal], point=pl.Base) + return [t] # dirty hack... Object creation should not be done here elif representation.is_a() in ["IfcPolyline","IfcCircle","IfcTrimmedCurve","IfcRectangleProfileDef"]: result = getCurveSet(representation) return result