Skip to content

Commit

Permalink
Merge pull request FreeCAD#19067 from Roy-043/Draft-Save-fillet-settings
Browse files Browse the repository at this point in the history
Draft: Save fillet settings
  • Loading branch information
Roy-043 authored Jan 16, 2025
2 parents 3385ac8 + 288f3aa commit caca0ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Mod/Draft/draftguitools/gui_fillets.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from draftguitools import gui_base_original
from draftguitools import gui_tool_utils
from draftmake import make_fillet
from draftutils import params
from draftutils import utils
from draftutils.messages import _err, _toolmsg
from draftutils.translate import translate
Expand Down Expand Up @@ -73,9 +74,9 @@ def Activated(self, name="Fillet"):
super().Activated(name=name)

if self.ui:
self.rad = 100
self.chamfer = False
self.delete = False
self.rad = params.get_param("FilletRadius")
self.chamfer = params.get_param("FilletChamferMode")
self.delete = params.get_param("FilletDeleteMode")
label = translate("draft", "Fillet radius")
tooltip = translate("draft", "Radius of fillet")

Expand Down Expand Up @@ -127,10 +128,12 @@ def action(self, arg):
def set_delete(self):
"""Execute as a callback when the delete checkbox changes."""
self.delete = self.ui.check_delete.isChecked()
params.set_param("FilletDeleteMode", self.delete)

def set_chamfer(self):
"""Execute as a callback when the chamfer checkbox changes."""
self.chamfer = self.ui.check_chamfer.isChecked()
params.set_param("FilletChamferMode", self.chamfer)

def numericRadius(self, rad):
"""Validate the entry radius in the user interface.
Expand All @@ -139,6 +142,7 @@ def numericRadius(self, rad):
when a valid radius has been entered in the input field.
"""
self.rad = rad
params.set_param("FilletRadius", self.rad)
self.draw_arc(rad, self.chamfer, self.delete)

def draw_arc(self, rad, chamfer, delete):
Expand Down
3 changes: 3 additions & 0 deletions src/Mod/Draft/draftutils/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ def _get_param_dictionary():
"DefaultPrintColor": ("unsigned", 255),
"Draft_array_fuse": ("bool", False),
"Draft_array_Link": ("bool", True),
"FilletRadius": ("float", 100.0),
"FilletChamferMode": ("bool", False),
"FilletDeleteMode": ("bool", False),
"fillmode": ("bool", True),
"GlobalMode": ("bool", False),
"GridHideInOtherWorkbenches": ("bool", True),
Expand Down

0 comments on commit caca0ac

Please sign in to comment.