diff --git a/src/Mod/CAM/Path/Main/Gui/Job.py b/src/Mod/CAM/Path/Main/Gui/Job.py index 509a5af80e..56a497546f 100644 --- a/src/Mod/CAM/Path/Main/Gui/Job.py +++ b/src/Mod/CAM/Path/Main/Gui/Job.py @@ -1149,7 +1149,9 @@ class TaskPanel: toolbit = selector.get_selected_tool() toolbit.attach_to_doc(FreeCAD.ActiveDocument) toolNum = self.obj.Proxy.nextToolNumber() - tc = PathToolControllerGui.Create(name=toolbit.label, tool=toolbit.obj, toolNumber=toolNum) + tc = PathToolControllerGui.Create( + name=f"TC: {toolbit.label}", tool=toolbit.obj, toolNumber=toolNum + ) self.obj.Proxy.addToolController(tc) FreeCAD.ActiveDocument.recompute() diff --git a/src/Mod/CAM/Path/Tool/shape/models/base.py b/src/Mod/CAM/Path/Tool/shape/models/base.py index 3d4ccd27d1..77cfa8c63b 100644 --- a/src/Mod/CAM/Path/Tool/shape/models/base.py +++ b/src/Mod/CAM/Path/Tool/shape/models/base.py @@ -718,8 +718,23 @@ class ToolBitShape(Asset): # Recompute the document to apply property changes tmp_doc.recompute() - # Copy the body to the given document without immediate compute. - return doc.copyObject(shape, True) + # Temporarily disable duplicate labels to let FreeCAD automatically + # make labels unique during the copy operation + + param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Document") + original_setting = param.GetBool("DuplicateLabels", False) + + try: + # Disable duplicate labels temporarily + param.SetBool("DuplicateLabels", False) + + # Copy the body - FreeCAD will now automatically make labels unique + copied_shape = doc.copyObject(shape, True) + + return copied_shape + finally: + # Restore the original setting + param.SetBool("DuplicateLabels", original_setting) """ Retrieves the thumbnail data for the tool bit shape in PNG format.