Sketcher ConstrainPointOnObject/en: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav
|[[Sketcher_ConstrainCoincident|Coincident]]
|[[Sketcher_ConstrainHorVer|Horizontal/Vertical]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Sketcher_ConstrainCoincident.svg
|IconR=Sketcher_ConstrainHorVer.svg
|IconC=Workbench_Sketcher.svg
}}


{{GuiCommand
{{GuiCommand
|Name=Sketcher ConstrainPointOnObject
|Name=Sketcher ConstrainPointOnObject
|Workbenches=[[Sketcher Workbench|Sketcher]]
|MenuLocation=Sketch → Sketcher constraints → Constrain point onto object
|MenuLocation=Sketch → Sketcher constraints → Constrain point onto object
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|Shortcut=Shift+O
|Shortcut={{KEY|O}}
|SeeAlso=[[Sketcher ConstrainCoincident|Constrain Coincident]]
|SeeAlso=[[Sketcher_ConstrainCoincidentUnified|Sketcher ConstrainCoincidentUnified]], [[Sketcher_ConstrainCoincident|Sketcher ConstrainCoincident]]
}}
}}


==Description==
==Description==
Affixes a point onto another object such as a line, arc, or sketch axis.


The [[Image:Sketcher_ConstrainPointOnObject.svg|24px]] [[Sketcher_ConstrainPointOnObject|Sketcher ConstrainPointOnObject]] command fixes points on edges or axes.
==How to Use==
#Select the point you want to affix onto a line/arc/etc. (Once selected the point become green).
#Select the line you want to be affixed onto the point you have just selected (Once selected the line become green).
#Press the {{KEY|[[File:Constraint_PointOnObject.png|24px]] '''Constrain point unto object'''}} button.


{{Version|0.22}}: This command is replaced by the [[Sketcher_ConstrainCoincidentUnified|Sketcher ConstrainCoincidentUnified]] command if the {{MenuCommand|Unify Coincident and PointOnObject}} option is selected in the [[Sketcher_Preferences#General|Sketcher Preferences]].
Note : The order you select the line and point does not matter. The point will always move to line. The line remains fixed.


== Scripting ==
==Usage==
The constraint can be created from macros and from the python console by using the following command:


# Optionally do one of the following:
{{clear}}
#* Select a single point and a single edge (in any order).
{{Code|code= Sketch.addConstraint(Sketcher.Constraint('PointOnObject',LineMoving,PointOfLineMoving,LineFixed))}}
#* Select several points and a single edge (idem).
#* Select a single point and several edges (idem).
# There are several ways to invoke the command:
#* Press the {{Button|[[Image:Sketcher_ConstrainPointOnObject.svg|16px]] [[Sketcher_ConstrainPointOnObject|Constrain point onto object]]}} button.
#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ConstrainPointOnObject.svg|16px]] Constrain point onto object}} option from the menu.
#* Use the keyboard shortcut: {{KEY|O}}.
# 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 two elements at a time now.
# To finish the command press {{KEY|Esc}} or the right mouse button, or start a another constraints or geometries command.


==Scripting==
where :


The constraint can be created from [[Macros|macros]] and from the [[Python|Python]] console by using the following command:
* Sketch is a sketch object
* LineMoving is the number that designates the line, which contains the point that has to be moved onto the LineFixed (The line which is fixed)
*PointOfLineMoving is the number of the vertex of line LineMoving, that has to be moved onto the LineFixed
*LinedFixed is the number of the line to be affixed onto the point PointOfLineMoving


{{incode|Sketch.addConstraint(Sketcher.Constraint('PointOnObject',LineMoving,PointOfLineMoving,LineFixed))}}
How to identify the number that designates lines and points ? Please refer to the scripting part of [[Sketcher ConstrainCoincident]].


* {{incode|Sketch}} is a sketch object.
* {{incode|LineMoving}} is the number that designates the line, which contains the point that has to be moved onto the {{incode|LineFixed}} (the line which is fixed).
* {{incode|PointOfLineMoving}} is the number of the vertex of line {{incode|LineMoving}}, that has to be moved onto the {{incode|LineFixed}}.
* {{incode|LinedFixed}} is the number of the line to be affixed onto the point {{incode|PointOfLineMoving}}.

The [[Sketcher_scripting|Sketcher scripting]] page explains how to identify the numbers that designate lines and points.


{{Docnav
|[[Sketcher_ConstrainCoincident|Coincident]]
|[[Sketcher_ConstrainHorVer|Horizontal/Vertical]]
|[[Sketcher_Workbench|Sketcher]]
|IconL=Sketcher_ConstrainCoincident.svg
|IconR=Sketcher_ConstrainHorVer.svg
|IconC=Workbench_Sketcher.svg
}}


{{Sketcher_Tools_navi{{#translation:}}}}
[[Category:Sketcher]]
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 13:59, 17 January 2024

Sketcher ConstrainPointOnObject

Menu location
Sketch → Sketcher constraints → Constrain point onto object
Workbenches
Sketcher
Default shortcut
O
Introduced in version
-
See also
Sketcher ConstrainCoincidentUnified, Sketcher ConstrainCoincident

Description

The Sketcher ConstrainPointOnObject command fixes points on edges or axes.

introduced in version 0.22: This command is replaced by the Sketcher ConstrainCoincidentUnified command if the Unify Coincident and PointOnObject option is selected in the Sketcher Preferences.

Usage

  1. Optionally do one of the following:
    • Select a single point and a single edge (in any order).
    • Select several points and a single edge (idem).
    • Select a single point and several edges (idem).
  2. There are several ways to invoke the command:
    • Press the Constrain point onto object button.
    • Select the Sketch → Sketcher constraints → Constrain point onto object option from the menu.
    • Use the keyboard shortcut: O.
  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 two elements 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

The constraint can be created from macros and from the Python console by using the following command:

Sketch.addConstraint(Sketcher.Constraint('PointOnObject',LineMoving,PointOfLineMoving,LineFixed))

  • Sketch is a sketch object.
  • LineMoving is the number that designates the line, which contains the point that has to be moved onto the LineFixed (the line which is fixed).
  • PointOfLineMoving is the number of the vertex of line LineMoving, that has to be moved onto the LineFixed.
  • LinedFixed is the number of the line to be affixed onto the point PointOfLineMoving.

The Sketcher scripting page explains how to identify the numbers that designate lines and points.