\documentclass{article}
\begin{document}
\tracingmacros=2
\newlength{\len} \setlength{\len}{1cm} we want to write out \verb$\len$ in cm
\the\len { oops, answer in pt}
\setlength{\len}{0.0352\len}
\the\len { good, now we just need to replace pt with cm}
\def\num#1pt{#1cm}
\num1pt { so far so good}
\def\temp{1pt}
\num\temp { not so hot} 0pt %0pt added to end of line just to prevent error message
\expandafter\num\temp { that works}
\expandafter\num\the\len { but not that} 0pt
\edef\temp{\the\len}
\expandafter\num\temp { okay I'm stuck} 0pt
\makeatletter
\strip@pt\len cm Thank you, that works great!
\makeatother
\end{document}
The document IS the question.
If you want to know what I wanted this for, check out \whereami
in
http://www.elfsoft2000.com/projects/speaker.pdf