From ed5ee5655d28526034e368591d151bae1a6e3c94 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 5 Apr 2022 16:03:46 +0200 Subject: [PATCH] Arch: Fixed text justify in IFC export --- src/Mod/Arch/exportIFC.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/exportIFC.py b/src/Mod/Arch/exportIFC.py index 5f1f37932e..5449a98775 100644 --- a/src/Mod/Arch/exportIFC.py +++ b/src/Mod/Arch/exportIFC.py @@ -1345,11 +1345,17 @@ def export(exportList, filename, colors=None, preferences=None): elif Draft.getType(anno) in ["DraftText","Text"]: l = FreeCAD.Vector(anno.Placement.Base).multiply(preferences['SCALE_FACTOR']) pos = ifcbin.createIfcCartesianPoint((l.x,l.y,l.z)) - tpl = ifcbin.createIfcAxis2Placement3D(pos,None,None) + zdir = ifcbin.createIfcDirection(tuple(anno.Placement.multVec(FreeCAD.Vector(0,0,1)))) + xdir = ifcbin.createIfcDirection(tuple(anno.Placement.multVec(FreeCAD.Vector(1,0,0)))) + tpl = ifcbin.createIfcAxis2Placement3D(pos,zdir,xdir) + alg = "LEFT" + if FreeCAD.GuiUp and hasattr(anno.ViewObject,"Justification"): + if anno.ViewObject.Justification == "Right": + alg = "RIGHT" s = ";".join(anno.Text) if six.PY2: s = s.encode("utf8") - txt = ifcfile.createIfcTextLiteral(s,tpl,"LEFT") + txt = ifcfile.createIfcTextLiteral(s,tpl,alg) reps = [txt] elif Draft.getType(anno) in ["Dimension","LinearDimension","AngularDimension"]: if FreeCAD.GuiUp: