We develop an algorithm for computing the closure of a given nilpotent $G_0$-orbit in $g_1$, where $g_1$ and $G_0$ are coming from a $Z$ or a $Z/mZ$-grading $g= bigoplus g_i$ of a simple complex Lie algebra $g$.