'How to line up objects along a drawn line?

I try to do the following: at the bottom of the screen there is a small window for drawing a line, in the center of the screen there are objects that line up in the drawn line

enter image description here

I apologize for my drawings :)

  1. How to make this drawing window?
  2. How to make objects line up in a drawn line? Thanks in advance.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source