%
% showdim.sty
% show dimensions in mm
% Petr Sojka sojka@muni.cz
%
{\catcode`p=12 \catcode`t=12 \gdef\DiM #1pt{#1}}
\def\WithoutPt #1{\expandafter \DiM \the #1}
\newdimen \D@men
\def\showdim#1{\D@men = #1 %
    \divide \D@men by 7227   % (1mm=72.27/25.40 pt)
    \multiply \D@men by 2540 % rough (due to roundoff) conversion pt -> mm
    \message{^^J>>>>\string#1=\WithoutPt {\D@men}mm<<<<^^J}}
\endinput
Example of usage:

\documentstyle[showdim]{article}

\setlength{\textwidth}{100mm}
\setlength{\textheight}{150mm}
\begin{document}
\showdim{\baselineskip}
\showdim{\textwidth}
\showdim{\textheight}
\showdim{\oddsidemargin}
\end{document}
