aboutsummaryrefslogtreecommitdiff
path: root/scripts/snippet.py
blob: 5857cd44d5f6a78cedeba200dff824cb819aaf5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()