|Sketch → Sketcher constraints → Constrain point onto object|
Affixes a point onto another object such as a line, arc, or axis.
Note : The order you select the line and point does not matter. The point will always move to line. The line remains fixed.
The constraint can be created from macros and from the python console by using the following command:
How to indentify the number that designates lines and points ? Please refer to the scripting part of this wiki page.