Line Snap

While you create a line in a 3D sketch, you can snap the line to geometry that already exists in the part, such as model surfaces or vertices, and sketch points.

Snap is not enabled if you are sketching in one of the major coordinate directions.

If you are sketching on a plane, and the SOLIDWORKS software infers a snap to a non-planar point, a temporary 3D graphics box is displayed to indicate an off-planar snap.

Video: 3D Line Snap