How to get All child menu Ids.?

Dear all
is it possible to get all child menu ids?
or
clear all child menu ids?

I want to draw dynamic child menu…

thanks.

I solved it myself.
Using menu.forEachItem function.
Thanks a lot.