Draft: Fixed DXF import with sketch mode on

This commit is contained in:
Yorik van Havre
2019-04-25 18:17:57 -03:00
parent 418fe7beff
commit dc64cdb18d
2 changed files with 34 additions and 27 deletions

View File

@@ -528,7 +528,7 @@ def drawArc(arc,forceShape=False):
try:
if (dxfCreateDraft or dxfCreateSketch) and (not forceShape):
pl = placementFromDXFOCS(arc)
return Draft.makeCircle(arc.radius,pl,False,firstangle,lastangle)
return Draft.makeCircle(circle.Radius,pl,False,firstangle,lastangle)
else:
return circle.toShape(math.radians(firstangle),math.radians(lastangle))
except Part.OCCError:
@@ -1115,6 +1115,7 @@ def processdxf(document,filename,getShapes=False,reComputeFlag=True):
shape = drawLine(line)
if shape:
if dxfCreateSketch:
FreeCAD.ActiveDocument.recompute()
if dxfMakeBlocks or dxfJoin:
if sketch:
shape = Draft.makeSketch(shape,autoconstraints=True,addTo=sketch)
@@ -1160,6 +1161,7 @@ def processdxf(document,filename,getShapes=False,reComputeFlag=True):
t = FreeCAD.ActiveDocument.addObject("Part::Feature","Shape")
t.Shape = shape
shape = t
FreeCAD.ActiveDocument.recompute()
if dxfMakeBlocks or dxfJoin:
if sketch:
shape = Draft.makeSketch(shape,autoconstraints=True,addTo=sketch)
@@ -1189,6 +1191,7 @@ def processdxf(document,filename,getShapes=False,reComputeFlag=True):
shape = drawArc(arc)
if shape:
if dxfCreateSketch:
FreeCAD.ActiveDocument.recompute()
if dxfMakeBlocks or dxfJoin:
if sketch:
shape = Draft.makeSketch(shape,autoconstraints=True,addTo=sketch)
@@ -1241,6 +1244,7 @@ def processdxf(document,filename,getShapes=False,reComputeFlag=True):
shape = drawCircle(circle)
if shape:
if dxfCreateSketch:
FreeCAD.ActiveDocument.recompute()
if dxfMakeBlocks or dxfJoin:
if sketch:
shape = Draft.makeSketch(shape,autoconstraints=True,addTo=sketch)