|
Menu location |
---|
Sketch → Sketcher constraints → Activate/deactivate constraint |
Workbenches |
Sketcher |
Default shortcut |
K Z |
Introduced in version |
0.19 |
See also |
Sketcher ToggleDrivingConstraint |
The Sketcher ToggleActiveConstraint tool activates or deactivates selected constraints. Deactivating constraints allows you to test other geometry arrangements without deleting constraints.
This is tool is similar to Sketcher ToggleDrivingConstraint, but contrary to that tool also works for geometric constraints, and values of deactivated dimensional constraints are preserved.
A fully constrained sketch.
One of the angular constraints has been deactivated, the sketch is no longer fully constrained.
The unconstrained geometry can be moved around. The deactivated constraint is still available, and can be re-activated to return to the fully constrained sketch.
See also: FreeCAD Scripting Basics.
The active status of a constraint can be controlled in macros and from the Python console.
SketchObject.toggleActive(index)
Use the toggleActive
method of an existing Sketcher SketchObject, and the index
of the constraint to activate it or deactivate it. The index starts from 0
all the way to N-1
, where N
is the total number of constraints.
Example:
import FreeCAD as App
sketch = App.ActiveDocument.Sketch
sketch.toggleActive(3)