User selected box orientation axes

Greetings.

Would you specify the piece of code you are having trouble with, please?