Fix Rotation of Origin For some reason my origin's rotation got terribly messed up. I have been trying to fix it by aligning the origin to a face or a vertex but it only gets worse. I need to make an array and for that reason clean up the origin's rotation. Because as it is right now I don't get a regular and even offset.

I would be grateful for any input because I am out of ideas on how to fix it. 

Thank you in advance!
It's 'easier' than it used to be, here's one way, using the 'View' Transform Orientation.


Find a reference rectangular face, preferably facing down your intended Z, select it in Edit Mode, and set the Transform Orientation to 'View'
Orthographic: ShiftNumpad 7 align your view to the face.
ShiftS > Cursor to Selected .. now the cursor should be centred on the face.
In Object Mode, with the Header > Options set to 'Origins', move the origin:  ShiftS > Selected to Cursor
Header > Object  > Transform menu.. Align to Transform Orientation. Now the Origin shoould be aligned with the view, and the face.


There may be some 90 degree swivels to do while in the view, to get your X,Y and Z on the right axes, and don't forget to switch the 'Origins' option off.