diff options
author | Christian Hodgden <chrhodgden@gmail.com> | 2024-06-28 16:02:04 +0000 |
---|---|---|
committer | Christian Hodgden <chrhodgden@gmail.com> | 2024-06-28 16:02:04 +0000 |
commit | 713c645fb37462db4c1781cfd348a494800c7237 (patch) | |
tree | d800a26108031f8c10f67466eb8a18098e702ffe /scripts/snippet.py | |
parent | d5b1f4c64698b71b3fa445f9e1200d89740955ed (diff) |
test snippet
Diffstat (limited to 'scripts/snippet.py')
-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() + |