From 7af96faef65095d37c6f18ef04ae4a6513ec67a2 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 11 Sep 2019 19:54:44 +0300 Subject: [PATCH] - fixed issue #302 where a copied object lost all the tools --- FlatCAMApp.py | 22 +++++++++++----------- README.md | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 7fc8f935..9874e0ed 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -5880,24 +5880,24 @@ class App(QtCore.QObject): self.report_usage("on_copy_object()") def initialize(obj_init, app): - obj_init.solid_geometry = obj.solid_geometry + obj_init.solid_geometry = deepcopy(obj.solid_geometry) try: - obj_init.follow_geometry = obj.follow_geometry + obj_init.follow_geometry = deepcopy(obj.follow_geometry) except AttributeError: pass try: - obj_init.apertures = obj.apertures + obj_init.apertures = deepcopy(obj.apertures) except AttributeError: pass try: if obj.tools: - obj_init.tools = obj.tools + obj_init.tools = deepcopy(obj.tools) except Exception as e: log.debug("App.on_copy_object() --> %s" % str(e)) def initialize_excellon(obj_init, app): - obj_init.tools = obj.tools + obj_init.tools = deepcopy(obj.tools) # drills are offset, so they need to be deep copied obj_init.drills = deepcopy(obj.drills) @@ -5921,29 +5921,29 @@ class App(QtCore.QObject): def on_copy_object2(self, custom_name): def initialize_geometry(obj_init, app): - obj_init.solid_geometry = obj.solid_geometry + obj_init.solid_geometry = deepcopy(obj.solid_geometry) try: - obj_init.follow_geometry = obj.follow_geometry + obj_init.follow_geometry = deepcopy(obj.follow_geometry) except AttributeError: pass try: - obj_init.apertures = obj.apertures + obj_init.apertures = deepcopy(obj.apertures) except AttributeError: pass try: if obj.tools: - obj_init.tools = obj.tools + obj_init.tools = deepcopy(obj.tools) except Exception as e: log.debug("on_copy_object2() --> %s" % str(e)) def initialize_gerber(obj_init, app): - obj_init.solid_geometry = obj.solid_geometry + obj_init.solid_geometry = deepcopy(obj.solid_geometry) obj_init.apertures = deepcopy(obj.apertures) obj_init.aperture_macros = deepcopy(obj.aperture_macros) def initialize_excellon(obj_init, app): - obj_init.tools = obj.tools + obj_init.tools = deepcopy(obj.tools) # drills are offset, so they need to be deep copied obj_init.drills = deepcopy(obj.drills) # slots are offset, so they need to be deep copied diff --git a/README.md b/README.md index b8c2346b..ff7a781d 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ CAD program, and create G-Code for Isolation routing. - fixed the TclCommand MillHoles - changed the name of TclCommand MillHoles to MillDrills and added a new TclCommand named MillSlots - modified the MillDrills and MillSlots TclCommands to accept as parameter a list of tool diameters to be milled instead of tool indexes +- fixed issue #302 where a copied object lost all the tools 10.09.2019