Sketcher ConstrainBlock: Difference between revisions

From FreeCAD Documentation
(Docnav)
(several ways added)
Line 25: Line 25:


<!--T:3-->
<!--T:3-->
'''Constrain Block''' blocks a geometric element in place with a single constraint.
The [[Image:Sketcher_ConstrainBlock.svg|24px]] [[Sketcher_ConstrainBlock|Sketcher ConstrainBlock]] command blocks a geometric element in place with a single constraint.


<!--T:12-->
<!--T:12-->
Line 34: Line 34:
<!--T:6-->
<!--T:6-->
# Select an element to constrain.
# Select an element to constrain.
# There are several ways to invoke the command:
# Press the {{Button|[[File:Sketcher_ConstrainBlock.svg|16px]] [[Sketcher_ConstrainBlock|Constrain block]]}} button.
#* Press the {{Button|[[Image:Sketcher_ConstrainBlock.svg|16px]] [[Sketcher_ConstrainBlock|Constrain block]]}} button.
#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ConstrainBlock.svg|16px]] Constrain block}} option from the menu.
#* {{Version|0.22}}: Right-click in the [[3D_view|3D view]] and select the {{MenuCommand|[[Image:Sketcher_ConstrainBlock.svg|16px]] Constrain block}} option from the context menu.
#* Use the keyboard shortcut: {{KEY|K}} then {{KEY|B}}.


<!--T:13-->
<!--T:13-->

Revision as of 22:57, 24 February 2024

Sketcher ConstrainBlock

Menu location
Sketch → Sketcher constraints → Constrain block
Workbenches
Sketcher
Default shortcut
K B
Introduced in version
0.17
See also
Sketcher Constrain Lock

Description

The Sketcher ConstrainBlock command blocks a geometric element in place with a single constraint.

It is mainly intended to be used with B-splines, which can be difficult to fully constrain otherwise.

Usage

  1. Select an element to constrain.
  2. There are several ways to invoke the command:
    • Press the Constrain block button.
    • Select the Sketch → Sketcher constraints → Constrain block option from the menu.
    • introduced in version 0.22: Right-click in the 3D view and select the Constrain block option from the context menu.
    • Use the keyboard shortcut: K then B.

Or press the button first, and then select the elements.

Scripting

Sketch.addConstraint(Sketcher.Constraint('Block', Edge))

The Sketcher scripting page explains the values which can be used for Edge and contains further examples on how to create constraints from Python scripts.