Creating an array of spheres

hello.everyone.I am struggling of creating an array of sphere and I have tried through “mmgs”.
while it completely cannnot work. Is there anyone can provide suggestions?


This ways to program is crazy,

the simple way is to build 1 mesh of sphere add after you just move the sphere to change the centre to
[ox[i],oy[0],oz[0]] for each i with movemesh function.

I have tried this method,
the procedure said that the Th3 does not exist.

Yes because the mesh Th3 is remove outside of brace

mesh3 Th3 = …
here Th3 do not exist (like in C++)