Difference between revisions of "Sketcher ConstrainParallel"

From FreeCAD Documentation
Jump to navigation Jump to search
(Scripting_Sketcher_constraints_in_Python -> Sketcher_scripting)
 
(6 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
|[[Sketcher_ConstrainPerpendicular|Perpendicular]]
 
|[[Sketcher_ConstrainPerpendicular|Perpendicular]]
 
|[[Sketcher_Workbench|Sketcher]]
 
|[[Sketcher_Workbench|Sketcher]]
|IconL=Constraint_Horizontal.svg
+
|IconL=Sketcher_ConstrainHorizontal.svg
 +
|IconR=Sketcher_ConstrainPerpendicular.svg
 
|IconC=Workbench_Sketcher.svg
 
|IconC=Workbench_Sketcher.svg
|IconR=Constraint_Perpendicular.png
 
 
}}
 
}}
  
Line 14: Line 14:
 
{{GuiCommand
 
{{GuiCommand
 
|Name=Sketcher ConstrainParallel
 
|Name=Sketcher ConstrainParallel
 +
|MenuLocation=Sketch → Sketcher constraints → Constrain parallel
 
|Workbenches=[[Sketcher_Workbench|Sketcher]]
 
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|MenuLocation=Sketch → Sketcher constraints → Constrain parallel
 
 
|Shortcut={{KEY|Shift}} + {{KEY|P}}
 
|Shortcut={{KEY|Shift}} + {{KEY|P}}
 
|SeeAlso=[[Sketcher_ConstrainVertical|Sketcher Constraint Vertical]], [[Sketcher_ConstrainHorizontal|Sketcher Constraint Horizontal]]
 
|SeeAlso=[[Sketcher_ConstrainVertical|Sketcher Constraint Vertical]], [[Sketcher_ConstrainHorizontal|Sketcher Constraint Horizontal]]
Line 50: Line 50:
 
<!--T:9-->
 
<!--T:9-->
 
{{Caption|Result: The selected lines are forced to be parallel to each other. Changing the orientation of one line will change the orientation of the other to be the same.}}
 
{{Caption|Result: The selected lines are forced to be parallel to each other. Changing the orientation of one line will change the orientation of the other to be the same.}}
 +
 +
== Scripting == <!--T:18-->
 +
 +
</translate>
 +
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Parallel', Line1, Line2))}}
 +
<translate>
 +
 +
<!--T:19-->
 +
The [[Sketcher_scripting|Sketcher scripting]] page explains the values which can be used for {{incode|Line1}} and {{incode|Line2}} and  contains further examples on how to create constraints from Python scripts.
 +
  
 
<!--T:13-->
 
<!--T:13-->
Line 56: Line 66:
 
|[[Sketcher_ConstrainPerpendicular|Perpendicular]]
 
|[[Sketcher_ConstrainPerpendicular|Perpendicular]]
 
|[[Sketcher_Workbench|Sketcher]]
 
|[[Sketcher_Workbench|Sketcher]]
|IconL=Constraint_Horizontal.svg
+
|IconL=Sketcher_ConstrainHorizontal.svg
 +
|IconR=Sketcher_ConstrainPerpendicular.svg
 
|IconC=Workbench_Sketcher.svg
 
|IconC=Workbench_Sketcher.svg
|IconR=Constraint_Perpendicular.png
 
 
}}
 
}}
  

Latest revision as of 23:23, 23 January 2021

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎polski • ‎português • ‎português do Brasil • ‎română • ‎svenska • ‎čeština • ‎русский

Sketcher ConstrainParallel.svg Sketcher ConstrainParallel

Menu location
Sketch → Sketcher constraints → Constrain parallel
Workbenches
Sketcher
Default shortcut
Shift + P
Introduced in version
-
See also
Sketcher Constraint Vertical, Sketcher Constraint Horizontal

Description

The Constrain Parallel constraint forces two selected straight lines or edges to be parallel to each other.

Operation

The sketch contains two randomly oriented lines.

ConstrainParallel1.png

Select both lines by clicking successively on each of them.

ConstrainParallel2.png

Apply the Constrain Parallel constraint by either:

  • Pressing the Sketcher ConstrainParallel.svg Constrain parallel button from the Sketcher constraints toolbar by selecting the Constraint Parallel menu item from the Sketcher constraints sub menu of the Sketcher (Sketcher workbench selected) or Part Design (Part Design workbench selected) menu item.
  • Use the Shift + P keyboard shortcut.
  • Use the Sketch → Sketcher constraints → Constrain parallel entry from the top menu.

ConstrainParallel3.png

Result: The selected lines are forced to be parallel to each other. Changing the orientation of one line will change the orientation of the other to be the same.

Scripting

Sketch.addConstraint(Sketcher.Constraint('Parallel', Line1, Line2))

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