I was experiencing some issues with PowderNotSolid's ruler script becouse it did not work if the axes were not aligned. I modified it to use the pythagorean theorem. Now it works.
Here is the code.