Sketcher ConstrainHorizontal: Difference between revisions

From FreeCAD Documentation
(Docnav)
(Revised.)
Line 1: Line 1:
<languages/>
<languages/>
{{UnfinishedDocu{{#translation:}}}}
<translate>
<translate>


Line 19: Line 18:
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|Shortcut={{KEY|H}}
|Shortcut={{KEY|H}}
|SeeAlso=[[Sketcher_ConstrainHorVer|Sketcher ConstrainHorVer]], [[Sketcher_ConstrainVertical|Sketcher ConstraintVertical]]
|SeeAlso=[[Sketcher_ConstrainVertical|Sketcher Constraint Vertical]]
}}
}}


Line 25: Line 24:


<!--T:4-->
<!--T:4-->
The Horizontal Constraint forces a selected line or lines in the sketch to be parallel to the horizontal axis of the sketch.
The [[Image:Sketcher_ConstrainHorizontal.svg|24px]] [[Sketcher_ConstrainHorizontal|Sketcher ConstrainHorizontal]] command constrains lines or pairs of points to be horizontal (parallel to the horizontal axis of the sketch).

{{Version|0.22}}: In most cases it is advisable to use the combined [[Sketcher_ConstrainHorVer|Sketcher ConstrainHorVer]] command instead.


==Usage== <!--T:3-->
==Usage== <!--T:3-->


<!--T:5-->
<!--T:5-->
# Optionally do one of the following:
[[File:HorizontalConstraint1.png|500px]]
#* Select two or more points.
{{Caption|Select a line in the sketch by clicking on it.}}
#* Select two or more lines. Points can be included in the selection, but will be ignored.

# There are several ways to invoke the command:
<!--T:10-->
#* {{Version|0.22}}: Press the down arrow to the right of the {{Button|[[Image:Sketcher_ConstrainHorVer.svg||x16px]][[Image:Toolbar_flyout_arrow.svg|x16px]]}} button and select the {{MenuCommand|[[Image:Sketcher_ConstrainHorizontal.svg|16px]] Constrain horizontally}} option.
[[File:HorizontalConstraint2.png|500px]]
#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ConstrainHorizontal.svg|16px]] Constrain horizontally}} option from the menu.
{{Caption|The line turns dark green.}}
#* Use the keyboard shortcut: {{KEY|H}}.

# To indicate that the command has been activated the cursor changed to a white cross with the command icon.
<!--T:11-->
# Optionally keep selecting elements. You can only select a single line or two points at a time now.
[[File:HorizontalConstraint3.png|500px]]
# To finish the command press {{KEY|Esc}} or the right mouse button, or start a another constraints or geometries command.
{{Caption|Apply the Horizontal Constraint by clicking on the {{Button|[[File:Sketcher_ConstrainHorizontal.svg|16px]] [[Sketcher_ConstrainHorizontal|Constraint horizontal]]}} in the Sketcher Constraints toolbar or by selecting the Constrain horizontally menu item in the Sketcher constraints sub menu of the Sketch menu item in the Sketcher work bench (or the Part Design menu item of the Part Design work bench). The selected line is constrained to be parallel to the horizontal axis of the sketch.}}

<!--T:12-->
[[File:HorizontalConstraint4.png|500px]]
{{Caption|Multiple lines may be selected}}

<!--T:13-->
[[File:HorizontalConstraint5.png|500px]]
{{Caption|and then applying the constraint as described above, they are constrained to be parallel to the sketch horizontal axis.}}


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

Revision as of 13:35, 17 January 2024

Sketcher ConstrainHorizontal

Menu location
Sketch → Sketcher constraints → Constrain horizontally
Workbenches
Sketcher
Default shortcut
H
Introduced in version
-
See also
Sketcher ConstrainHorVer, Sketcher ConstraintVertical

Description

The Sketcher ConstrainHorizontal command constrains lines or pairs of points to be horizontal (parallel to the horizontal axis of the sketch).

introduced in version 0.22: In most cases it is advisable to use the combined Sketcher ConstrainHorVer command instead.

Usage

  1. Optionally do one of the following:
    • Select two or more points.
    • Select two or more lines. Points can be included in the selection, but will be ignored.
  2. There are several ways to invoke the command:
    • introduced in version 0.22: Press the down arrow to the right of the button and select the Constrain horizontally option.
    • Select the Sketch → Sketcher constraints → Constrain horizontally option from the menu.
    • Use the keyboard shortcut: H.
  3. To indicate that the command has been activated the cursor changed to a white cross with the command icon.
  4. Optionally keep selecting elements. You can only select a single line or two points at a time now.
  5. To finish the command press Esc or the right mouse button, or start a another constraints or geometries command.

Scripting

Sketch.addConstraint(Sketcher.Constraint('Horizontal', Line))

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