From a7b29065dfd30dd271c85390d162379045b5dc43 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 14 Feb 2016 07:40:32 +0200 Subject: [PATCH] Solved issue #188: Order of the drill bits in Gcode generation from Excellon file The tools are ordered by diameter as I found that the tools order in the Excellon file is not always diameter based. There is also a plated / no-plated holes criteria. The tools in the GUI tool-list are selected all by default. If the user wants to select only some tools, he should be carefull when selecting the tools as the order of the selection will be the actual order of the tools in G-code. --- FlatCAMObj.py | 6 ++++++ camlib.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/FlatCAMObj.py b/FlatCAMObj.py index e19a0f9b..8b7126a0 100644 --- a/FlatCAMObj.py +++ b/FlatCAMObj.py @@ -648,6 +648,12 @@ class FlatCAMExcellon(FlatCAMObj, Excellon): dia.setFlags(QtCore.Qt.ItemIsEnabled) self.ui.tools_table.setItem(i, 1, dia) # Diameter i += 1 + + # sort the tool diameter column + self.ui.tools_table.sortItems(1) + # all the tools are selected by default + self.ui.tools_table.selectColumn(0) + self.ui.tools_table.resizeColumnsToContents() self.ui.tools_table.resizeRowsToContents() self.ui.tools_table.horizontalHeader().setStretchLastSection(True) diff --git a/camlib.py b/camlib.py index c4edaf47..7e77d3a9 100644 --- a/camlib.py +++ b/camlib.py @@ -2746,7 +2746,7 @@ class CNCjob(Geometry): gcode += self.pausecode + "\n" - for tool in points: + for tool in tools: # Tool change sequence (optional) if toolchange: