Skip to content

Commit d879e37

Browse files
committed
check_version.py: Add the MagnetHoleChamfer property for v0.11.9 migration.
MagnetHoleChamfer is needed for baseplates with magnet holes since v0.11.9.
1 parent fcbff39 commit d879e37

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

freecad/gridfinity_workbench/check_version.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ def migrate_object_version(obj: fc.DocumentObject) -> None: # noqa: C901
2727

2828
### v0.11.9 Changes ###
2929

30+
if (
31+
getattr(obj, "Baseplate", False)
32+
and hasattr(obj, "MagnetHoles")
33+
and not hasattr(obj, "MagnetHoleChamfer")
34+
):
35+
# Add property for the magnet hole chamfer.
36+
obj.addProperty(
37+
"App::PropertyLength",
38+
"MagnetHoleChamfer",
39+
"GridfinityNonStandard",
40+
"The depth at which magnet hole chamfer starts.",
41+
).MagnetHoleChamfer = 0.25
42+
3043
if hasattr(obj, "MagnetHoles"):
3144
# Add properties for the crush ribs to hold magnets.
3245
if not hasattr(obj, "CrushRibsCount"):

0 commit comments

Comments
 (0)