From 0a9ff5f3aa2003101753cce87ff42f91ec8fc524 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Fri, 31 Aug 2018 19:36:19 -0700 Subject: [PATCH] Fixed base geometry selection for multiple base models. --- src/Mod/Path/PathScripts/PathOpGui.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathOpGui.py b/src/Mod/Path/PathScripts/PathOpGui.py index de8249a41b..17c672792d 100644 --- a/src/Mod/Path/PathScripts/PathOpGui.py +++ b/src/Mod/Path/PathScripts/PathOpGui.py @@ -381,20 +381,15 @@ class TaskPanelBaseGeometryPage(TaskPanelPage): return 'edges' return 'nothing' - def addBaseGeometry(self, selection): - PathLog.track(selection) - if len(selection) != 1: - PathLog.error(translate("PathProject", "Please select %s from a single solid" % self.featureName())) - return False - sel = selection[0] + def addBaseGeometrySelection(self, sel): if sel.HasSubObjects: - if not self.supportsVertexes() and selection[0].SubObjects[0].ShapeType == "Vertex": + if not self.supportsVertexes() and sel.SubObjects[0].ShapeType == "Vertex": PathLog.error(translate("PathProject", "Vertexes are not supported")) return False - if not self.supportsEdges() and selection[0].SubObjects[0].ShapeType == "Edge": + if not self.supportsEdges() and sel.SubObjects[0].ShapeType == "Edge": PathLog.error(translate("PathProject", "Edges are not supported")) return False - if not self.supportsFaces() and selection[0].SubObjects[0].ShapeType == "Face": + if not self.supportsFaces() and sel.SubObjects[0].ShapeType == "Face": PathLog.error(translate("PathProject", "Faces are not supported")) return False else: @@ -406,6 +401,17 @@ class TaskPanelBaseGeometryPage(TaskPanelPage): self.obj.Proxy.addBase(self.obj, sel.Object, sub) return True + def addBaseGeometry(self, selection): + PathLog.track(selection) + #if len(selection) != 1: + # PathLog.error(translate("PathProject", "Please select %s from a single solid" % self.featureName())) + # return False + changed = False + for sel in selection: + if self.addBaseGeometrySelection(sel): + changed = True + return changed + def addBase(self): if self.addBaseGeometry(FreeCADGui.Selection.getSelectionEx()): # self.obj.Proxy.execute(self.obj)