Arch: Fixed IFC import/export of dimensions

This commit is contained in:
Yorik van Havre
2022-04-06 11:35:18 +02:00
parent d41395bbd1
commit 002ba58bad
3 changed files with 15 additions and 8 deletions

View File

@@ -1378,8 +1378,14 @@ def export(exportList, filename, colors=None, preferences=None):
if curves:
reps.append(ifcfile.createIfcGeometricCurveSet(curves))
l = FreeCAD.Vector(vp.tbase).multiply(preferences['SCALE_FACTOR'])
zdir = None
xdir = None
if hasattr(vp,"trot"):
r = FreeCAD.Rotation(vp.trot[0],vp.trot[1],vp.trot[2],vp.trot[3])
zdir = ifcbin.createIfcDirection(tuple(r.multVec(FreeCAD.Vector(0,0,1))))
xdir = ifcbin.createIfcDirection(tuple(r.multVec(FreeCAD.Vector(1,0,0))))
pos = ifcbin.createIfcCartesianPoint((l.x,l.y,l.z))
tpl = ifcbin.createIfcAxis2Placement3D(pos,None,None)
tpl = ifcbin.createIfcAxis2Placement3D(pos,zdir,xdir)
if six.PY2:
s = s.encode("utf8")
txt = ifcfile.createIfcTextLiteral(vp.string,tpl,"LEFT")

View File

@@ -860,11 +860,12 @@ def get2DShape(representation,scaling=1000):
elif item.is_a("IfcTextLiteral"):
pl = getPlacement(item.Placement, scaling)
if pl:
t = Draft.make_text(item.Literal.split(";"), pl.Base)
t = Draft.make_text(item.Literal.split(";"), pl)
if FreeCAD.GuiUp:
if item.Path == "RIGHT":
t.ViewObject.Justification = "Right"
return [] # TODO dirty hack... Object creation should not be done here
# do not return because there might be more than one representation
#return [] # TODO dirty hack... Object creation should not be done here
elif representation.is_a() in ["IfcPolyline","IfcCircle","IfcTrimmedCurve","IfcRectangleProfileDef"]:
result = getCurveSet(representation)
return result