Problem with the 3D Orientation of an Oriented bounding box OBB

Hello every bodies , I created an 3D oriented bounding box OBB of a set points.When I tried to draw the OBB I found that there are a problem with its orientation like in the picture enclosed .Someone can help me plz ?Thank you

SolidworksApi macros