From a8faace09816d2dc0b57d58691dc7429b414bb71 Mon Sep 17 00:00:00 2001 From: Dan Falck Date: Sat, 24 Dec 2016 17:28:40 -0800 Subject: [PATCH] PATH:units added Gui::InputField to some parms old spinboxes were not aware of units so I substituted in the custom FreeCAD Gui:InputField on countour, profile, profile edges, and pocket operations. --- .../Path/Gui/Resources/panels/ContourEdit.ui | 89 +++++++++++-------- .../Path/Gui/Resources/panels/PocketEdit.ui | 84 ++++++++++------- .../Gui/Resources/panels/ProfileEdgesEdit.ui | 81 ++++++++++------- .../Path/Gui/Resources/panels/ProfileEdit.ui | 86 ++++++++++-------- src/Mod/Path/PathScripts/PathContour.py | 18 ++-- src/Mod/Path/PathScripts/PathPocket.py | 12 +-- src/Mod/Path/PathScripts/PathProfile.py | 26 +++--- src/Mod/Path/PathScripts/PathProfileEdges.py | 18 ++-- .../PathScripts/PathToolLibraryManager.py | 10 --- 9 files changed, 237 insertions(+), 187 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/ContourEdit.ui b/src/Mod/Path/Gui/Resources/panels/ContourEdit.ui index fd7024e7ee..d5f3c8c822 100644 --- a/src/Mod/Path/Gui/Resources/panels/ContourEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/ContourEdit.ui @@ -23,7 +23,7 @@ - 0 + 3 @@ -81,15 +81,12 @@ - - - 3 - + - 0.100000000000000 + 0.000000000000000 - - 1.000000000000000 + + mm @@ -280,35 +277,8 @@ - - - - Extra Offset - - - - - - - - - - Segment Length - - - - - - - - - - Roll Radius - - - - - + + @@ -317,8 +287,49 @@ - - + + + + Roll Radius + + + + + + + Segment Length + + + + + + + Extra Offset + + + + + + + + + + 0.000000000000000 + + + mm + + + + + + + 0.000000000000000 + + + mm + + diff --git a/src/Mod/Path/Gui/Resources/panels/PocketEdit.ui b/src/Mod/Path/Gui/Resources/panels/PocketEdit.ui index edb60bf132..c4ebd835a0 100644 --- a/src/Mod/Path/Gui/Resources/panels/PocketEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PocketEdit.ui @@ -10,6 +10,12 @@ 525 + + + 0 + 0 + + 0 @@ -23,7 +29,7 @@ - 0 + 5 @@ -34,7 +40,7 @@ 0 0 334 - 329 + 321 @@ -112,7 +118,7 @@ 0 0 334 - 329 + 321 @@ -165,19 +171,6 @@ - - - - 3 - - - 0.100000000000000 - - - 1.000000000000000 - - - @@ -185,6 +178,16 @@ + + + + 0.000000000000000 + + + mm + + + @@ -193,7 +196,7 @@ 0 0 334 - 329 + 321 @@ -243,7 +246,7 @@ 0 0 334 - 329 + 321 @@ -257,7 +260,7 @@ 0 0 334 - 329 + 321 @@ -331,7 +334,7 @@ 0 0 334 - 329 + 321 @@ -406,20 +409,35 @@ - + - - - - - Material Allowance - - - - - - - + + + + + + + Material Allowance + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + 0.000000000000000 + + + mm + diff --git a/src/Mod/Path/Gui/Resources/panels/ProfileEdgesEdit.ui b/src/Mod/Path/Gui/Resources/panels/ProfileEdgesEdit.ui index 80ad39a545..200acefd70 100644 --- a/src/Mod/Path/Gui/Resources/panels/ProfileEdgesEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/ProfileEdgesEdit.ui @@ -23,7 +23,7 @@ - 0 + 4 @@ -34,7 +34,7 @@ 0 0 334 - 319 + 313 @@ -111,8 +111,8 @@ 0 0 - 168 - 99 + 334 + 313 @@ -151,19 +151,6 @@ - - - - 3 - - - 0.100000000000000 - - - 1.000000000000000 - - - @@ -171,6 +158,22 @@ + + + + 10000.000000000000000 + + + 0.000000000000000 + + + 8 + + + mm + + + @@ -178,8 +181,8 @@ 0 0 - 165 - 70 + 334 + 313 @@ -229,7 +232,7 @@ 0 0 334 - 319 + 313 @@ -285,9 +288,9 @@ 0 - 0 - 322 - 306 + -15 + 320 + 338 @@ -331,8 +334,18 @@ - - + + + + + + + 0.000000000000000 + + + mm + + @@ -341,9 +354,6 @@ - - - @@ -351,9 +361,6 @@ - - - @@ -361,7 +368,7 @@ - + @@ -371,6 +378,16 @@ + + + + 0.000000000000000 + + + mm + + + diff --git a/src/Mod/Path/Gui/Resources/panels/ProfileEdit.ui b/src/Mod/Path/Gui/Resources/panels/ProfileEdit.ui index 8238fc6856..74293db727 100644 --- a/src/Mod/Path/Gui/Resources/panels/ProfileEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/ProfileEdit.ui @@ -23,7 +23,7 @@ - 0 + 4 @@ -34,7 +34,7 @@ 0 0 381 - 353 + 346 @@ -112,7 +112,7 @@ 0 0 381 - 353 + 346 @@ -151,19 +151,6 @@ - - - - 3 - - - 0.100000000000000 - - - 1.000000000000000 - - - @@ -171,6 +158,19 @@ + + + + 10000.000000000000000 + + + 0.000000000000000 + + + mm + + + @@ -179,7 +179,7 @@ 0 0 381 - 353 + 346 @@ -229,7 +229,7 @@ 0 0 381 - 353 + 346 @@ -285,9 +285,9 @@ 0 - 0 - 381 - 353 + -28 + 367 + 384 @@ -345,6 +345,13 @@ + + + + Plunge Angle + + + @@ -352,9 +359,6 @@ - - - @@ -362,12 +366,6 @@ - - - - - - @@ -375,15 +373,31 @@ - - - - Plunge Angle + + + + + + + 0.000000000000000 + + + mm - - + + + + + + + 0.000000000000000 + + + mm + + diff --git a/src/Mod/Path/PathScripts/PathContour.py b/src/Mod/Path/PathScripts/PathContour.py index 3e33b6a5e1..f113e720f4 100644 --- a/src/Mod/Path/PathScripts/PathContour.py +++ b/src/Mod/Path/PathScripts/PathContour.py @@ -67,8 +67,8 @@ class ObjectContour: # Depth Properties obj.addProperty("App::PropertyDistance", "ClearanceHeight", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","The height needed to clear clamps and obstructions")) obj.addProperty("App::PropertyDistance", "SafeHeight", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Rapid Safety Height between locations.")) - obj.addProperty("App::PropertyFloatConstraint", "StepDown", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Incremental Step Down of Tool")) - obj.StepDown = (1, 0.01, 1000, 0.5) + obj.addProperty("App::PropertyDistance", "StepDown", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Incremental Step Down of Tool")) + #obj.StepDown = (1, 0.01, 1000, 0.5) obj.addProperty("App::PropertyDistance", "StartDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Starting Depth of Tool- first cut depth in Z")) obj.addProperty("App::PropertyDistance", "FinalDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Final Depth of Tool- lowest value in Z")) @@ -198,7 +198,7 @@ class ObjectContour: depthparams = depth_params( obj.ClearanceHeight.Value, - obj.SafeHeight.Value, obj.StartDepth.Value, obj.StepDown, 0.0, + obj.SafeHeight.Value, obj.StartDepth.Value, obj.StepDown.Value, 0.0, obj.FinalDepth.Value, None) PathKurveUtils.profile2( @@ -447,13 +447,13 @@ class TaskPanel: if hasattr(self.obj, "ClearanceHeight"): self.obj.ClearanceHeight = self.form.clearanceHeight.text() if hasattr(self.obj, "StepDown"): - self.obj.StepDown = self.form.stepDown.value() + self.obj.StepDown = self.form.stepDown.text() if hasattr(self.obj, "OffsetExtra"): - self.obj.OffsetExtra = self.form.extraOffset.value() + self.obj.OffsetExtra = self.form.extraOffset.text() if hasattr(self.obj, "SegLen"): self.obj.SegLen = self.form.segLen.value() if hasattr(self.obj, "RollRadius"): - self.obj.RollRadius = self.form.rollRadius.value() + self.obj.RollRadius = self.form.rollRadius.text() if hasattr(self.obj, "PlungeAngle"): self.obj.PlungeAngle = str(self.form.plungeAngle.value()) if hasattr(self.obj, "UseComp"): @@ -471,10 +471,10 @@ class TaskPanel: self.form.finalDepth.setText(str(self.obj.FinalDepth.Value)) self.form.safeHeight.setText(str(self.obj.SafeHeight.Value)) self.form.clearanceHeight.setText(str(self.obj.ClearanceHeight.Value)) - self.form.stepDown.setValue(self.obj.StepDown) - self.form.extraOffset.setValue(self.obj.OffsetExtra.Value) + self.form.stepDown.setText(str(self.obj.StepDown.Value)) + self.form.extraOffset.setText(str(self.obj.OffsetExtra.Value)) self.form.segLen.setValue(self.obj.SegLen.Value) - self.form.rollRadius.setValue(self.obj.RollRadius.Value) + self.form.rollRadius.setText(str(self.obj.RollRadius.Value)) self.form.plungeAngle.setValue(self.obj.PlungeAngle.Value) self.form.useCompensation.setChecked(self.obj.UseComp) self.form.useStartPoint.setChecked(self.obj.UseStartPoint) diff --git a/src/Mod/Path/PathScripts/PathPocket.py b/src/Mod/Path/PathScripts/PathPocket.py index fdffa28599..6689e178ed 100644 --- a/src/Mod/Path/PathScripts/PathPocket.py +++ b/src/Mod/Path/PathScripts/PathPocket.py @@ -65,8 +65,8 @@ class ObjectPocket: # Depth Properties obj.addProperty("App::PropertyDistance", "ClearanceHeight", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","The height needed to clear clamps and obstructions")) obj.addProperty("App::PropertyDistance", "SafeHeight", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Rapid Safety Height between locations.")) - obj.addProperty("App::PropertyFloatConstraint", "StepDown", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Incremental Step Down of Tool")) - obj.StepDown = (0.0, 0.01, 100.0, 0.5) + obj.addProperty("App::PropertyDistance", "StepDown", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Incremental Step Down of Tool")) + #obj.StepDown = (0.0, 0.01, 100.0, 0.5) obj.addProperty("App::PropertyDistance", "StartDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Starting Depth of Tool- first cut depth in Z")) obj.addProperty("App::PropertyDistance", "FinalDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Final Depth of Tool- lowest value in Z")) obj.addProperty("App::PropertyDistance", "FinishDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Maximum material removed on final pass.")) @@ -553,9 +553,9 @@ class TaskPanel: if hasattr(self.obj, "ClearanceHeight"): self.obj.ClearanceHeight = self.form.clearanceHeight.text() if hasattr(self.obj, "StepDown"): - self.obj.StepDown = self.form.stepDown.value() + self.obj.StepDown = self.form.stepDown.text() if hasattr(self.obj, "MaterialAllowance"): - self.obj.MaterialAllowance = self.form.extraOffset.value() + self.obj.MaterialAllowance = self.form.extraOffset.text() if hasattr(self.obj, "UseStartPoint"): self.obj.UseStartPoint = self.form.useStartPoint.isChecked() if hasattr(self.obj, "Algorithm"): @@ -578,8 +578,8 @@ class TaskPanel: self.form.finalDepth.setText(str(self.obj.FinalDepth.Value)) self.form.safeHeight.setText(str(self.obj.SafeHeight.Value)) self.form.clearanceHeight.setText(str(self.obj.ClearanceHeight.Value)) - self.form.stepDown.setValue(self.obj.StepDown) - self.form.extraOffset.setValue(self.obj.MaterialAllowance.Value) + self.form.stepDown.setText(str(self.obj.StepDown)) + self.form.extraOffset.setText(str(self.obj.MaterialAllowance.Value)) self.form.useStartPoint.setChecked(self.obj.UseStartPoint) self.form.useZigZag.setChecked(self.obj.UseZigZag) self.form.zigZagUnidirectional.setChecked(self.obj.ZigUnidirectional) diff --git a/src/Mod/Path/PathScripts/PathProfile.py b/src/Mod/Path/PathScripts/PathProfile.py index 72e04326e2..2ac149e8b9 100644 --- a/src/Mod/Path/PathScripts/PathProfile.py +++ b/src/Mod/Path/PathScripts/PathProfile.py @@ -68,8 +68,8 @@ class ObjectProfile: # Depth Properties obj.addProperty("App::PropertyDistance", "ClearanceHeight", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","The height needed to clear clamps and obstructions")) obj.addProperty("App::PropertyDistance", "SafeHeight", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Rapid Safety Height between locations.")) - obj.addProperty("App::PropertyFloatConstraint", "StepDown", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Incremental Step Down of Tool")) - obj.StepDown = (1, 0.01, 1000, 0.5) + obj.addProperty("App::PropertyDistance", "StepDown", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Incremental Step Down of Tool")) + #obj.StepDown = (1, 0.01, 1000, 0.5) obj.addProperty("App::PropertyDistance", "StartDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Starting Depth of Tool- first cut depth in Z")) obj.addProperty("App::PropertyDistance", "FinalDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Final Depth of Tool- lowest value in Z")) @@ -96,8 +96,8 @@ class ObjectProfile: obj.addProperty("App::PropertyDistance", "OffsetExtra", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property","Extra value to stay away from final profile- good for roughing toolpath")) obj.addProperty("App::PropertyLength", "SegLen", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property","Tesselation value for tool paths made from beziers, bsplines, and ellipses")) obj.addProperty("App::PropertyAngle", "PlungeAngle", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property","Plunge angle with which the tool enters the work piece. Straight down is 90 degrees, if set small enough or zero the tool will descent exactly one layer depth down per turn")) - obj.addProperty("App::PropertyBool", "processHoles", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property","Profile holes as well as the outline")) - obj.addProperty("App::PropertyBool", "processPerimeter", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property","Profile the outline")) + obj.addProperty("App::PropertyBool", "processHoles", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property","Profile holes as well as the outline")) + obj.addProperty("App::PropertyBool", "processPerimeter", "Profile", QtCore.QT_TRANSLATE_NOOP("App::Property","Profile the outline")) obj.addProperty("App::PropertyVectorList", "locs", "Tags", QtCore.QT_TRANSLATE_NOOP("App::Property","List of holding tag locations")) @@ -165,7 +165,7 @@ class ObjectProfile: obj.Base = baselist self.execute(obj) - def _buildPathLibarea(self, obj, edgelist, isHole): + def _buildPathLibarea(self, obj, edgelist, isHole): import PathScripts.PathKurveUtils as PathKurveUtils import math import area @@ -194,7 +194,7 @@ class ObjectProfile: output = "" output += "G0 Z" + str(obj.ClearanceHeight.Value) + "F " + PathUtils.fmt(self.vertRapid) + "\n" - curve = PathKurveUtils.makeAreaCurve(edgelist, direction, startpoint, endpoint) + curve = PathKurveUtils.makeAreaCurve(edgelist, direction, startpoint, endpoint) '''The following line uses a profile function written for use with FreeCAD. It's clean but incomplete. It doesn't handle print "x = " + str(point.x) @@ -230,7 +230,7 @@ print "y - " + str(point.y) depthparams = depth_params( obj.ClearanceHeight.Value, - obj.SafeHeight.Value, obj.StartDepth.Value, obj.StepDown, 0.0, + obj.SafeHeight.Value, obj.StartDepth.Value, obj.StepDown.Value, 0.0, obj.FinalDepth.Value, None) PathKurveUtils.profile2( @@ -495,13 +495,13 @@ class TaskPanel: if hasattr(self.obj, "ClearanceHeight"): self.obj.ClearanceHeight = self.form.clearanceHeight.text() if hasattr(self.obj, "StepDown"): - self.obj.StepDown = self.form.stepDown.value() + self.obj.StepDown = self.form.stepDown.text() if hasattr(self.obj, "OffsetExtra"): - self.obj.OffsetExtra = self.form.extraOffset.value() + self.obj.OffsetExtra = self.form.extraOffset.text() if hasattr(self.obj, "SegLen"): self.obj.SegLen = self.form.segLen.value() if hasattr(self.obj, "RollRadius"): - self.obj.RollRadius = self.form.rollRadius.value() + self.obj.RollRadius = self.form.rollRadius.text() if hasattr(self.obj, "PlungeAngle"): self.obj.PlungeAngle = str(self.form.plungeAngle.value()) if hasattr(self.obj, "UseComp"): @@ -525,10 +525,10 @@ class TaskPanel: self.form.finalDepth.setText(str(self.obj.FinalDepth.Value)) self.form.safeHeight.setText(str(self.obj.SafeHeight.Value)) self.form.clearanceHeight.setText(str(self.obj.ClearanceHeight.Value)) - self.form.stepDown.setValue(self.obj.StepDown) - self.form.extraOffset.setValue(self.obj.OffsetExtra.Value) + self.form.stepDown.setText(str(self.obj.StepDown)) + self.form.extraOffset.setText(str(self.obj.OffsetExtra.Value)) self.form.segLen.setValue(self.obj.SegLen.Value) - self.form.rollRadius.setValue(self.obj.RollRadius.Value) + self.form.rollRadius.setText(str(self.obj.RollRadius.Value)) self.form.plungeAngle.setValue(self.obj.PlungeAngle.Value) self.form.useCompensation.setChecked(self.obj.UseComp) self.form.useStartPoint.setChecked(self.obj.UseStartPoint) diff --git a/src/Mod/Path/PathScripts/PathProfileEdges.py b/src/Mod/Path/PathScripts/PathProfileEdges.py index a56a21440e..2c71d6adfc 100644 --- a/src/Mod/Path/PathScripts/PathProfileEdges.py +++ b/src/Mod/Path/PathScripts/PathProfileEdges.py @@ -70,8 +70,8 @@ class ObjectProfile: # Depth Properties obj.addProperty("App::PropertyDistance", "ClearanceHeight", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","The height needed to clear clamps and obstructions")) obj.addProperty("App::PropertyDistance", "SafeHeight", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Rapid Safety Height between locations")) - obj.addProperty("App::PropertyFloatConstraint", "StepDown", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Incremental Step Down of Tool")) - obj.StepDown = (1, 0.01, 1000, 0.5) + obj.addProperty("App::PropertyDistance", "StepDown", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Incremental Step Down of Tool")) + #obj.StepDown = (1, 0.01, 1000, 0.5) obj.addProperty("App::PropertyDistance", "StartDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Starting Depth of Tool- first cut depth in Z")) obj.addProperty("App::PropertyDistance", "FinalDepth", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","Final Depth of Tool- lowest value in Z")) @@ -226,7 +226,7 @@ print "y - " + str(point.y) depthparams = depth_params( obj.ClearanceHeight.Value, - obj.SafeHeight.Value, obj.StartDepth.Value, obj.StepDown, 0.0, + obj.SafeHeight.Value, obj.StartDepth.Value, obj.StepDown.Value, 0.0, obj.FinalDepth.Value, None) PathKurveUtils.profile2( @@ -482,13 +482,13 @@ class TaskPanel: if hasattr(self.obj, "ClearanceHeight"): self.obj.ClearanceHeight = self.form.clearanceHeight.text() if hasattr(self.obj, "StepDown"): - self.obj.StepDown = self.form.stepDown.value() + self.obj.StepDown = self.form.stepDown.text() if hasattr(self.obj, "OffsetExtra"): - self.obj.OffsetExtra = self.form.extraOffset.value() + self.obj.OffsetExtra = self.form.extraOffset.text() if hasattr(self.obj, "SegLen"): self.obj.SegLen = self.form.segLen.value() if hasattr(self.obj, "RollRadius"): - self.obj.RollRadius = self.form.rollRadius.value() + self.obj.RollRadius = self.form.rollRadius.text() if hasattr(self.obj, "PlungeAngle"): self.obj.PlungeAngle = str(self.form.plungeAngle.value()) if hasattr(self.obj, "UseComp"): @@ -510,10 +510,10 @@ class TaskPanel: self.form.finalDepth.setText(str(self.obj.FinalDepth.Value)) self.form.safeHeight.setText(str(self.obj.SafeHeight.Value)) self.form.clearanceHeight.setText(str(self.obj.ClearanceHeight.Value)) - self.form.stepDown.setValue(self.obj.StepDown) - self.form.extraOffset.setValue(self.obj.OffsetExtra.Value) + self.form.stepDown.setText(str(self.obj.StepDown.Value)) + self.form.extraOffset.setText(str(self.obj.OffsetExtra.Value)) self.form.segLen.setValue(self.obj.SegLen.Value) - self.form.rollRadius.setValue(self.obj.RollRadius.Value) + self.form.rollRadius.setText(str(self.obj.RollRadius.Value)) self.form.plungeAngle.setValue(self.obj.PlungeAngle.Value) self.form.useCompensation.setChecked(self.obj.UseComp) self.form.useStartPoint.setChecked(self.obj.UseStartPoint) diff --git a/src/Mod/Path/PathScripts/PathToolLibraryManager.py b/src/Mod/Path/PathScripts/PathToolLibraryManager.py index c8e482d794..67103a5130 100644 --- a/src/Mod/Path/PathScripts/PathToolLibraryManager.py +++ b/src/Mod/Path/PathScripts/PathToolLibraryManager.py @@ -190,16 +190,6 @@ class ToolLibraryManager(): headers = ["","Tool Num.","Name","Tool Type","Material","Diameter","Length Offset","Flat Radius","Corner Radius","Cutting Edge Angle","Cutting Edge Height"] model = QtGui.QStandardItemModel() model.setHorizontalHeaderLabels(headers) - parms = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units") - digits = parms.GetContents()[1][2] # user's number of digits of precision - if parms.GetContents()[0][2]==0: - suffix = 'mm' - conversion = 1.0 - elif parms.GetContents()[0][2]==3: - suffix = 'in' - conversion = 25.4 - else: - suffix = '' def unitconv(ivalue): parms = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units")