How do I check if a line or a linear object 3d is perfectly straight along the X axis for example?
Here's a video- This could be a way for you to do this.
Video: Blender: How to Align Vertices, Edges or Faces - Revised

Also the align tools options. Video: Align tools




For more exact dimensions there's a good tutorial that has helped me.  I do a lot of 3D printing and I use Blender as my CAD modeller along with the Cad Transform plug-in.
Video: Cad Transform plug-in