Draft: Fixed further regressions

This commit is contained in:
Yorik van Havre
2020-04-21 12:46:08 +02:00
parent dc742e8523
commit 6f2fd04518
4 changed files with 6 additions and 6 deletions

View File

@@ -514,7 +514,7 @@ def makeCopy(obj,force=None,reparent=False):
_Point(newobj)
if gui:
_ViewProviderPoint(newobj.ViewObject)
elif (getType(obj) == "Dimension") or (force == "Dimension"):
elif (getType(obj) in ["Dimension","LinearDimension"]) or (force == "Dimension"):
newobj = FreeCAD.ActiveDocument.addObject(obj.TypeId,getRealName(obj.Name))
_Dimension(newobj)
if gui:
@@ -1025,7 +1025,7 @@ def move(objectslist,vector,copy=False):
else:
newobj = obj
newobj.Placement.Base = obj.Placement.Base.add(real_vector)
elif getType(obj) == "Dimension":
elif getType(obj) in ["Dimension","LinearDimension"]:
if copy:
newobj = FreeCAD.ActiveDocument.addObject("App::FeaturePython",getRealName(obj.Name))
_Dimension(newobj)
@@ -1589,7 +1589,7 @@ def getDXF(obj,direction=None):
ny = DraftVecUtils.project(vec,plane.v)
return Vector(nx.Length,ny.Length,0)
if getType(obj) == "Dimension":
if getType(obj) in ["Dimension","LinearDimension"]:
p1 = getProj(obj.Start)
p2 = getProj(obj.End)
p3 = getProj(obj.Dimline)

View File

@@ -485,7 +485,7 @@ def getSVG(obj,scale=1,linewidth=0.35,fontsize=12,fillstyle="shape color",direct
svg += getPath(obj.Edges,pathname="")
elif getType(obj) == "Dimension":
elif getType(obj) in ["Dimension","LinearDimension"]:
if gui:
if not obj.ViewObject:
print ("export of dimensions to SVG is only available in GUI mode")

View File

@@ -3817,7 +3817,7 @@ def export(objectslist, filename, nospline=False, lwPoly=False):
style='STANDARD',
layer=getStrGroup(ob)))
elif Draft.getType(ob) == "Dimension":
elif Draft.getType(ob) in ["Dimension","LinearDimension"]:
p1 = DraftVecUtils.tup(ob.Start)
p2 = DraftVecUtils.tup(ob.End)
base = Part.LineSegment(ob.Start, ob.End).toShape()

View File

@@ -1526,7 +1526,7 @@ class svgHandler(xml.sax.ContentHandler):
# see issue #2062
sh = sh.transformGeometry(transform)
return sh
elif Draft.getType(sh) == "Dimension":
elif Draft.getType(sh) in ["Dimension","LinearDimension"]:
pts = []
for p in [sh.Start, sh.End, sh.Dimline]:
cp = Vector(p)