Sketcher ConstrainHorizontal/en: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>
{{UnfinishedDocu{{#translation:}}}}


{{Docnav
{{Docnav
Line 16: Line 15:
|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]]
}}
}}


==Description==
==Description==


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==
==Usage==


# 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:
[[File:HorizontalConstraint2.png|500px]]
#* {{VersionMinus|0.21}}: Press the {{Button|[[Image:Sketcher_ConstrainHorizontal.svg|16px]] [[Sketcher_ConstrainHorizontal|Constrain horizontally]]}} button.
{{Caption|The line turns dark green.}}
#* {{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.

#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ConstrainHorizontal.svg|16px]] Constrain horizontally}} option from the menu.
[[File:HorizontalConstraint3.png|500px]]
#* Use the keyboard shortcut: {{KEY|H}}.
{{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.}}
# To indicate that the command has been activated the cursor changes to a white cross with the command icon.

# Optionally keep selecting elements. You can only select a single line or two points at a time now.
[[File:HorizontalConstraint4.png|500px]]
# To finish the command press {{KEY|Esc}} or the right mouse button, or start a another constraints or geometries command.
{{Caption|Multiple lines may be selected}}

[[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 ==
== Scripting ==

Revision as of 09:24, 20 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:
    • version 0.21 and below: Press the Constrain horizontally button.
    • 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 changes 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.