In trying answer Is it possible to use a macro to name a TikZ node?, I attempted to use the solution provided at pgfmath expansion - call a command from within a pgfmath environment, but this yielded the error message
Incomplete \iffalse; all text was ignored after line 67.
<inserted text>
\fi
from the example
\documentclass{article}
\usepackage{tikz}
\newcommand{\mathresult}[1]{%
\pgfmathparse{#1}\pgfmathsetmacro\mymathresult{\pgfmathresult}%
}
\newcommand{\mymacro}[2]{%
\mathresult{#1}%
\pgfmathparse{#2 + \mymathresult}%
\pgfmathsetmacro\mymathresult{\pgfmathresult}\mathresult%
}%
\begin{document}
\begin{tikzpicture}
\node (0) at (0,0) {X};
\node (\mymacro{2}{3}) at (1,2) {Y};
\draw (\mymacro{2}{3}) -- (0);
\draw (5) -- +(3,0) {Z};
\end{tikzpicture}
\end{document}