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)
Line 15: Line 15:
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|Shortcut={{KEY|O}}
|Shortcut={{KEY|O}}
|SeeAlso=[[Sketcher_ConstrainCoincidentUnified|Sketcher Constrain Coincident Unified]], [[Sketcher_ConstrainCoincident|Sketcher Constrain Coincident]]
|SeeAlso=[[Sketcher_ConstrainCoincidentUnified|Sketcher ConstrainCoincidentUnified]], [[Sketcher_ConstrainCoincident|Sketcher ConstrainCoincident]]
}}
}}


==Description==
==Description==


The [[Image:Sketcher_ConstrainPointOnObject.svg|24px]] [[Sketcher_ConstrainPointOnObject|Sketcher ConstrainPointOnObject]] command fixes points on edges or axes.
Affixes a point onto another object such as a line, arc, or sketch axis.

{{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]].


==Usage==
==Usage==


# Optionally do one of the following:
# Select a point and an edge in any order.
#* Select a single point and a single edge (in any order).
# There are several ways to invoke the command:
#* Select several points and a single edge (idem).
#* Press the {{Button|[[File:Sketcher_ConstrainPointOnObject.svg|16px]] [[Sketcher_ConstrainPointOnObject|Constrain point onto object]]}} button in the toolbar.
#* Select a single point and several edges (idem).
#* Use the {{KEY|O}} keyboard shortcut.
# There are several ways to invoke the command:
#* Use the {{MenuCommand|Sketch → Sketcher constraints → [[File:Sketcher_ConstrainPointOnObject.svg|16px]] Constrain point onto object}} entry in the top menu.
#* 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 changed 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==
==Scripting==

Revision as of 16:51, 15 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 changed 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.