From 5509a9b438874cfc74982b699b18357bed57739c Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Wed, 14 Aug 2019 10:29:09 +0800 Subject: [PATCH] Draft: fix Link(Path)Array --- src/Mod/Draft/Draft.py | 11 +++-------- src/Mod/Draft/DraftGui.py | 5 ++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 099cb2f6e8..49add3ddd7 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -1288,9 +1288,6 @@ def makeArray(baseobject,arg1,arg2,arg3,arg4=None,arg5=None,arg6=None,name="Arra if len(obj.Base.ViewObject.DiffuseColor) > 1: obj.ViewObject.Proxy.resetColors(obj.ViewObject) baseobject.ViewObject.hide() - formatObject(obj,obj.Base) - if len(obj.Base.ViewObject.DiffuseColor) > 1: - obj.ViewObject.Proxy.resetColors(obj.ViewObject) select(obj) return obj @@ -1329,9 +1326,6 @@ def makePathArray(baseobject,pathobject,count,xlate=None,align=False,pathobjsubs if len(obj.Base.ViewObject.DiffuseColor) > 1: obj.ViewObject.Proxy.resetColors(obj.ViewObject) baseobject.ViewObject.hide() - formatObject(obj,obj.Base) - if len(obj.Base.ViewObject.DiffuseColor) > 1: - obj.ViewObject.Proxy.resetColors(obj.ViewObject) select(obj) return obj @@ -5939,8 +5933,9 @@ class _PathArray(_DraftLink): else: FreeCAD.Console.PrintLog ("_PathArray.createGeometry: path " + obj.PathObj.Name + " has no edges\n") return - base = self.pathArray(obj.Base.Placement,w,obj.Count,obj.Xlate,obj.Align) - return _DraftLink.buildShape(self,obj,pl,base) + base = calculatePlacementsOnPath( + obj.Base.Shape.Placement.Rotation,w,obj.Count,obj.Xlate,obj.Align) + obj.Shape = _DraftLink.buildShape(self,obj,pl,base) def getWireFromSubs(self,obj): '''Make a wire from PathObj subelements''' diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index e8a80c7289..876aa688ed 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -40,7 +40,7 @@ Report to Draft.py for info import six -import FreeCAD, FreeCADGui, os, Draft, sys, DraftVecUtils, math +import FreeCAD, FreeCADGui, os, Draft, sys, traceback, DraftVecUtils, math try: from PySide import QtCore, QtGui, QtSvg @@ -150,6 +150,7 @@ class todo: else: f() except: + FreeCAD.Console.PrintLog (traceback.format_exc()) wrn = "[Draft.todo.tasks] Unexpected error:", sys.exc_info()[0], "in ", f, "(", arg, ")" FreeCAD.Console.PrintWarning (wrn) except ReferenceError: @@ -171,6 +172,7 @@ class todo: func() FreeCAD.ActiveDocument.commitTransaction() except: + FreeCAD.Console.PrintLog (traceback.format_exc()) wrn = "[Draft.todo.commit] Unexpected error:", sys.exc_info()[0], "in ", func FreeCAD.Console.PrintWarning (wrn) # restack Draft screen widgets after creation @@ -185,6 +187,7 @@ class todo: else: f() except: + FreeCAD.Console.PrintLog (traceback.format_exc()) wrn = "[Draft.todo.tasks] Unexpected error:", sys.exc_info()[0], "in ", f, "(", arg, ")" FreeCAD.Console.PrintWarning (wrn) todo.afteritinerary = []