From 31ae323e733fb78063b80efc5d2a4bcd0d36ad0c Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Sat, 6 Jun 2020 14:01:32 -0500 Subject: [PATCH] Path: Add `ShapeName` property to ToolBit objects The new `ShapeName` is the name of the FreeCAD shape file containing the 3D body of the cutter. We might want to change the source of the `ShapeName` to the name of the first Body object in the shape file, rather than the name of the file itself. --- src/Mod/Path/PathScripts/PathToolBit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/Path/PathScripts/PathToolBit.py b/src/Mod/Path/PathScripts/PathToolBit.py index fa1b1fcffb..78a564658b 100644 --- a/src/Mod/Path/PathScripts/PathToolBit.py +++ b/src/Mod/Path/PathScripts/PathToolBit.py @@ -151,6 +151,7 @@ class ToolBit(object): obj.addProperty('App::PropertyFile', 'BitShape', 'Base', translate('PathToolBit', 'Shape for bit shape')) obj.addProperty('App::PropertyLink', 'BitBody', 'Base', translate('PathToolBit', 'The parametrized body representing the tool bit')) obj.addProperty('App::PropertyFile', 'File', 'Base', translate('PathToolBit', 'The file of the tool')) + obj.addProperty('App::PropertyString', 'ShapeName', 'Base', translate('PathToolBit', 'The name of the shape file')) if shapeFile is None: obj.BitShape = 'endmill.fcstd' self._setupBitShape(obj) @@ -230,6 +231,7 @@ class ToolBit(object): if not path and p != obj.BitShape: obj.BitShape = p doc = FreeCAD.open(p) + obj.ShapeName = doc.Name docOpened = True return (doc, docOpened)