diff options
-rw-r--r-- | scripts/snippet.py | 18 |
1 files changed, 18 insertions, 0 deletions
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() + |