From f7527927c6480c41140245b348b9de2bf02ff4fa Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Thu, 2 Jan 2020 12:08:34 -0800 Subject: [PATCH] Enable loop detection if it /could/ succeed but don't actually calculate it until activated. --- src/Mod/Path/PathCommands.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathCommands.py b/src/Mod/Path/PathCommands.py index 400072e429..64b37604ef 100644 --- a/src/Mod/Path/PathCommands.py +++ b/src/Mod/Path/PathCommands.py @@ -35,6 +35,7 @@ from PathScripts.PathUtils import findParentJob if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore + from PySide import QtGui else: def translate(ctxt, txt): return txt @@ -68,7 +69,8 @@ class _CommandSelectLoop: self.obj = sel.Object self.sub = sel.SubElementNames if sel.SubObjects: - self.active = self.formsPartOfALoop(sel.Object, sel.SubObjects[0], sel.SubElementNames) + #self.active = self.formsPartOfALoop(sel.Object, sel.SubObjects[0], sel.SubElementNames) + self.active = True else: self.active = False return self.active @@ -102,6 +104,10 @@ class _CommandSelectLoop: for i in loopwire.Edges: if e.hashCode() == i.hashCode(): FreeCADGui.Selection.addSelection(obj, "Edge" + str(elist.index(e) + 1)) + elif FreeCAD.GuiUp: + QtGui.QMessageBox.information(None, + QtCore.QT_TRANSLATE_NOOP('Path_SelectLoop', 'Feature Completion'), + QtCore.QT_TRANSLATE_NOOP('Path_SelectLoop', 'Closed loop detection failed.')) def formsPartOfALoop(self, obj, sub, names): try: