Path: Fix Import feature of Base Geometry
Error was thrown if FreeCADGui.Selection list had more than one item. Solution is to clear selection before adding selection from import operation. I also removed the `for` loop since the selection should be singular.
This commit is contained in:
@@ -601,12 +601,13 @@ class TaskPanelBaseGeometryPage(TaskPanelPage):
|
|||||||
def importBaseGeometry(self):
|
def importBaseGeometry(self):
|
||||||
opLabel = str(self.form.geometryImportList.currentText())
|
opLabel = str(self.form.geometryImportList.currentText())
|
||||||
ops = FreeCAD.ActiveDocument.getObjectsByLabel(opLabel)
|
ops = FreeCAD.ActiveDocument.getObjectsByLabel(opLabel)
|
||||||
if ops.__len__() > 1:
|
if len(ops) > 1:
|
||||||
msg = translate('PathOpGui', 'Mulitiple operations are labeled as')
|
msg = translate('PathOpGui', 'Mulitiple operations are labeled as')
|
||||||
msg += " {}\n".format(opLabel)
|
msg += " {}\n".format(opLabel)
|
||||||
FreeCAD.Console.PrintWarning(msg)
|
FreeCAD.Console.PrintWarning(msg)
|
||||||
for (base, subList) in ops[0].Base:
|
(base, subList) = ops[0].Base[0]
|
||||||
FreeCADGui.Selection.addSelection(base, subList)
|
FreeCADGui.Selection.clearSelection()
|
||||||
|
FreeCADGui.Selection.addSelection(base, subList)
|
||||||
self.addBase()
|
self.addBase()
|
||||||
|
|
||||||
def registerSignalHandlers(self, obj):
|
def registerSignalHandlers(self, obj):
|
||||||
|
|||||||
Reference in New Issue
Block a user