Arch: Fixed IFC import/export of dimensions
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -595,10 +595,10 @@ class ViewProviderLinearDimension(ViewProviderDimensionBase):
|
||||
else:
|
||||
offset = DraftVecUtils.scaleTo(v1, 0.05)
|
||||
|
||||
rott = rot1
|
||||
self.trot = rot1
|
||||
if hasattr(vobj, "FlipText") and vobj.FlipText:
|
||||
_rott = App.Rotation(rott[0], rott[1], rott[2], rott[3])
|
||||
rott = _rott.multiply(App.Rotation(App.Vector(0, 0, 1), 180)).Q
|
||||
_rott = App.Rotation(self.trot[0], self.trot[1], self.trot[2], self.trot[3])
|
||||
self.trot = _rott.multiply(App.Rotation(App.Vector(0, 0, 1), 180)).Q
|
||||
offset = offset.negative()
|
||||
|
||||
# On first run the `DisplayMode` enumeration is not set, so we trap
|
||||
@@ -628,8 +628,8 @@ class ViewProviderLinearDimension(ViewProviderDimensionBase):
|
||||
self.textpos.translation.setValue([self.tbase.x,
|
||||
self.tbase.y,
|
||||
self.tbase.z])
|
||||
self.textpos.rotation = coin.SbRotation(rott[0], rott[1],
|
||||
rott[2], rott[3])
|
||||
self.textpos.rotation = coin.SbRotation(self.trot[0], self.trot[1],
|
||||
self.trot[2], self.trot[3])
|
||||
|
||||
show_unit = True
|
||||
if hasattr(vobj, "ShowUnit"):
|
||||
|
||||
Reference in New Issue
Block a user