Sketcher ConstrainPointOnObject: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 35: Line 35:
#* Select several points and a single edge (idem).
#* Select several points and a single edge (idem).
#* Select a single point and several edges (idem).
#* Select a single point and several edges (idem).
# There are several ways to invoke the command:
# There are several ways to invoke the command:
#* Press the {{Button|[[File:Sketcher_ConstrainPointOnObject.svg|16px]] [[Sketcher_ConstrainPointOnObject|Constrain point onto object]]}} button in the toolbar.
#* 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 {{KEY|O}} keyboard shortcut.
#* Use the keyboard shortcut: {{KEY|O}}.
#* Use the {{MenuCommand|Sketch → Sketcher constraints → [[File:Sketcher_ConstrainPointOnObject.svg|16px]] Constrain point onto object}} entry in the top menu.


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

Revision as of 16:00, 14 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 only available if the Unify Coincident and PointOnObject option is not selected in the Sketcher Preferences.

Usage

  1. 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.

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.