I have some coordinates (say A, B, C).
Now I make sth. like this: \foreach \P in {A,B,C} \draw[fill=pink] (\P) circle[radius=2.5pt];
If I would have said \foreach \P in {A,B,C,X} \draw[fill=pink] (\P) circle[radius=2.5pt];
I would have got the error No shape named 'X' is known.
So my question is: How could I have sth. like the symbolic code
\ifcoordinateexist
\draw[fill=pink] (\P) circle[radius=2.5pt];
\else % nothing
\fi
I there a simple solution, maybe with TikZ-tools?
\documentclass[border=2mm, tikz]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[]
\coordinatelabel=A at (0,0);
\coordinatelabel=B at (2,3);
\coordinatelabel=C at (1,1);
% Will work:
\foreach \P in {A,B,C} \draw[fill=pink] (\P) circle[radius=2.5pt];
%% Will not work:
%\foreach \P in {A,B,C,X} \draw[fill=pink] (\P) circle[radius=2.5pt];
% ---------> No shape named `X' is known.
\end{tikzpicture}
\end{document}



coordinateis a kind of specialized nodes, so naming the\ifXXXwith\ifNodeDefinedis better. ii) tikz nodes are defined globally (also mentioned in Martin Scharrer's original answer), so if there is a nodeXdefined in previous tikzpicture(s), then this test would fail. – muzimuzhi Z Dec 16 '20 at 14:45tikzpicturewhich be used to assign a distinct internal macro to every node. This will take some time since I'm not familiar with the node implementations yet. – muzimuzhi Z Dec 19 '20 at 16:47\ifcoorddefined. – muzimuzhi Z Dec 20 '20 at 22:34