Orient geometry to direction of vector

The vector is the shortest distance. I want to rotate the green boxes to be parallel with the arrows.

solved like this