Sketcher ConstrainBlock: Difference between revisions

From FreeCAD Documentation
(Button template)
(Scripting_Sketcher_constraints_in_Python -> Sketcher_scripting)
(8 intermediate revisions by 5 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:8-->
<!--T:8-->
{{Docnav
{{Docnav|[[Sketcher_ConstrainSymmetric|Symmetric]]|[[Sketcher ConstrainLock|Lock]]|[[Sketcher_Workbench|Sketcher]]|IconL=Constraint_Symmetric.png|IconC=Workbench_Sketcher.svg|IconR=Sketcher_ConstrainLock.svg‎}}
|[[Sketcher_ConstrainSymmetric|Symmetric]]
|[[Sketcher_ConstrainLock|Lock]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Constraint_Symmetric.svg
|IconR=Sketcher_ConstrainLock.svg‎
|IconC=Workbench_Sketcher.svg
}}


<!--T:1-->
<!--T:1-->
Line 8: Line 15:
|Name=Sketcher ConstrainBlock
|Name=Sketcher ConstrainBlock
|MenuLocation=Sketch → Sketcher constraints → Constrain Block
|MenuLocation=Sketch → Sketcher constraints → Constrain Block
|Workbenches=[[Sketcher Workbench|Sketcher]]
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|SeeAlso=[[Sketcher_ConstrainLock|Constrain Lock]]
|Version=0.17
|Version=0.17
|SeeAlso=[[Sketcher_ConstrainLock|Sketcher Constrain Lock]]
}}
}}


Line 18: Line 25:
'''Constrain Block''' blocks a geometric element in place with a single constraint.
'''Constrain Block''' blocks a geometric element in place with a single constraint.


<!--T:12-->
It is mainly intended to be used with {{Button|[[File:Sketcher_CreateBSpline.svg|16px]] [[Sketcher_CreateBSpline|B-Splines]]}}, which can be difficult to fully constrain otherwise.
It is mainly intended to be used with {{Button|[[File:Sketcher_CreateBSpline.svg|16px]] [[Sketcher_CreateBSpline|B-Splines]]}}, which can be difficult to fully constrain otherwise.


Line 26: Line 34:
# Press the {{Button|[[File:Sketcher_ConstrainBlock.svg|16px]] [[Sketcher_ConstrainBlock|Constrain Block]]}} button.
# Press the {{Button|[[File:Sketcher_ConstrainBlock.svg|16px]] [[Sketcher_ConstrainBlock|Constrain Block]]}} button.


<!--T:13-->
Or press the button first, and then select the elements.
Or press the button first, and then select the elements.

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

</translate>
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Block', Edge))}}
<translate>

<!--T:15-->
The [[Sketcher_scripting|Sketcher scripting]] page explains the values which can be used for {{incode|Edge}} and contains further examples on how to create constraints from Python scripts.



<!--T:9-->
<!--T:9-->
{{Docnav
{{Docnav|[[Sketcher_ConstrainSymmetric|Symmetric]]|[[Sketcher ConstrainLock|Lock]]|[[Sketcher_Workbench|Sketcher]]|IconL=Constraint_Symmetric.png|IconC=Workbench_Sketcher.svg|IconR=Sketcher_ConstrainLock.svg‎}}
|[[Sketcher_ConstrainSymmetric|Symmetric]]
|[[Sketcher_ConstrainLock|Lock]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Constraint_Symmetric.svg
|IconR=Sketcher_ConstrainLock.svg‎
|IconC=Workbench_Sketcher.svg
}}


</translate>
</translate>

Revision as of 23:31, 23 January 2021

Sketcher ConstrainBlock

Menu location
Sketch → Sketcher constraints → Constrain Block
Workbenches
Sketcher
Default shortcut
None
Introduced in version
0.17
See also
Sketcher Constrain Lock

Description

Constrain Block 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. Press the Constrain Block button.

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.