GuiCommand: Name: Sketcher ToggleActiveConstraint Workbenches: Sketcher_Workbench MenuLocation: Sketch , Sketcher constraints , Activate/deactivate constraint Shortcut: K Z Version: 0.19 SeeAlso: Sketcher_ToggleDrivingConstraint
Sketcher ToggleActiveConstraint
Description
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.
Usage
-
Select one or more constraints.
-
There are several ways to invoke the tool:
-
Press the
Activate/deactivate constraint button.
-
Select the Sketch → Sketcher constraints →
Activate/deactivate constraint option from the menu.
-
(v1.0)
: Right-click in the 3D view and select the
Activate/deactivate constraint option from the context menu.
-
In the Constraints section of the Sketcher Dialog select the Activate or Deactivate option from the context menu. The offered option depends on the state of the constraint under the cursor.
-
Use the keyboard shortcut: K then Z.
-
-
Active selected constraints are deactivated and turn grey (default color), while deactivated selected constraints are activated and return to red (default color).
Example
![](https://raw.githubusercontent.com/FreeCAD/FreeCAD-documentation/master/wiki/images/Sketcher_ToggleActiveConstraint_example_active.png)
![](https://raw.githubusercontent.com/FreeCAD/FreeCAD-documentation/master/wiki/images/Sketcher_ToggleActiveConstraint_example_disabled_1.png)
![](https://raw.githubusercontent.com/FreeCAD/FreeCAD-documentation/master/wiki/images/Sketcher_ToggleActiveConstraint_example_disabled_2.png)
Scripting
See also:
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)
⏵ documentation index > Sketcher > Sketcher ToggleActiveConstraint
This page is retrieved from https://github.com/FreeCAD/FreeCAD-documentation/blob/main/wiki/Sketcher_ToggleActiveConstraint.md