From 713c645fb37462db4c1781cfd348a494800c7237 Mon Sep 17 00:00:00 2001 From: Christian Hodgden Date: Fri, 28 Jun 2024 16:02:04 +0000 Subject: test snippet --- scripts/snippet.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts/snippet.py diff --git a/scripts/snippet.py b/scripts/snippet.py new file mode 100644 index 0000000..5857cd4 --- /dev/null +++ b/scripts/snippet.py @@ -0,0 +1,18 @@ +import FreeCAD as App + +# Access the active document +doc = App.activeDocument() + +# Find the subtractive sphere by its name (assuming it's named 'SubtractiveSphere') +subtractive_sphere = doc.getObject('SubtractiveSphere') + +# Boolean value to check +chk = True # Set this to False to set the radius to 0 mm + +# Set the radius based on the boolean value +if subtractive_sphere: + subtractive_sphere.Radius = 2.5 if chk else 0 + + # Recompute the document to apply changes + doc.recompute() + -- cgit v1.2.3