Sketcher ToggleActiveConstraint: Difference between revisions

From FreeCAD Documentation
(WIP)
(V0.22 -> V1.0)
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{Page_in_progress}}
<translate>
<translate>


Line 38: Line 37:
#* Press the {{Button|[[Image:Sketcher_ToggleActiveConstraint.svg|16px]] [[Sketcher_ToggleActiveConstraint|Activate/deactivate constraint]]}} button.
#* Press the {{Button|[[Image:Sketcher_ToggleActiveConstraint.svg|16px]] [[Sketcher_ToggleActiveConstraint|Activate/deactivate constraint]]}} button.
#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ToggleActiveConstraint.svg|16px]] Activate/deactivate constraint}} option from the menu.
#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ToggleActiveConstraint.svg|16px]] Activate/deactivate constraint}} option from the menu.
#* {{Version|0.22}}: Right-click in the [[3D_view|3D view]] and select the {{MenuCommand|[[Image:Sketcher_ToggleActiveConstraint.svg|16px]] Activate/deactivate constraint}} option from the context menu.
#* {{Version|1.0}}: Right-click in the [[3D_view|3D view]] and select the {{MenuCommand|[[Image:Sketcher_ToggleActiveConstraint.svg|16px]] Activate/deactivate constraint}} option from the context menu.
#* In the {{MenuCommand|Constraints}} section of the [[Task_panel|Task panel]] select the {{MenuCommand|Activate}} or {{MenuCommand|Deactivate}} option from the context menu. (The option depends on the cursor position: over an active constraint it is Deaktivate and over a deactivated one it is Activate respektively)
#* In the '''Constraints''' section of the [[Sketcher_Dialog|Sketcher Dialog]] select the {{MenuCommand|Activate}} or {{MenuCommand|Deactivate}} option from the context menu. The offered option depends on the state of the constraint under the cursor.
#* Use the keyboard shortcut: {{KEY|K}} then {{KEY|Z}}.
#* Use the keyboard shortcut: {{KEY|K}} then {{KEY|Z}}.
# Active selected constraints are deactivated and turn grey while deactivated selected constraints are activated and return to red.
# Active selected constraints are deactivated and turn grey (default [[Sketcher_Preferences#Appearance|color]]), while deactivated selected constraints are activated and return to red (default color).


== Examples == <!--T:8-->
== Example == <!--T:8-->


</translate>
</translate>
[[File:Sketcher_ToggleActiveConstraint_example_active.png|x350px]]
[[File:Sketcher_ToggleActiveConstraint_example_active.png|400px]]
<translate>
<translate>
<!--T:9-->
<!--T:9-->
{{Caption|Fully constrained sketch.}}
{{Caption|A fully constrained sketch.}}


</translate>
</translate>
[[File:Sketcher_ToggleActiveConstraint_example_disabled_1.png|x350px]] [[File:Sketcher_ToggleActiveConstraint_example_disabled_2.png|x350px]]
[[File:Sketcher_ToggleActiveConstraint_example_disabled_1.png|400px]]
<translate>
<translate>
<!--T:10-->
<!--T:10-->
{{Caption|One of the angular constraints has been deactivated, the sketch is no longer fully constrained.}}
{{Caption|Left: deactivated constraint; the sketch is no longer fully constrained. Right: the unconstrained geometry can be moved around; the older constraint is still available, and can be re-activated to return to the fully constrained sketch.}}


</translate>
<!--T:11-->
[[File:Sketcher_ToggleActiveConstraint_example_disabled_2.png|400px]]
[[File:Sketcher_ToggleActiveConstraint_task_panel.png|x350px]]
<translate>
{{Caption|Task panel with the deactivated constraint.}}
<!--T:18-->
{{Caption|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.}}


== Scripting == <!--T:12-->
== Scripting == <!--T:12-->

Latest revision as of 10:24, 21 April 2024

Sketcher ToggleActiveConstraint

Menu location
Sketch → Sketcher constraints → Activate/deactivate constraint
Workbenches
Sketcher
Default shortcut
K Z
Introduced in version
0.19
See also
Sketcher ToggleDrivingConstraint

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

  1. Select one or more constraints.
  2. 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.
    • introduced in version 1.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.
  3. Active selected constraints are deactivated and turn grey (default color), while deactivated selected constraints are activated and return to red (default color).

Example

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.

Scripting

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)