How to cycle create UI_COMMAND?

Hi, I have the same problem.
Can you please share with me your full code of how you use UI_COMMAND_Function in for loop?