Maya commands and the random library are imported first. Then functions to randomize position, scale, and rotation.
I used lists for these- 0=x, 1=y, 2=z.
That's because for the UI, instead of doing three separate float fields for user input, I used a float field group and specified 3 fields. Less copy pasting on my part!
In the UI the user can chose between spawning random meshes, spheres, cubes, or cylinders.
Should random shape be chosen, it'll pick one from the list of valid mesh types. The chosen shape regardless gets "poly" append to the front (in hindsight I could've just let the labels contain the phrase in the first place) before using the maya command to spawn the corresponding mesh.
I also feed the position, rotation, and scale information through this function.
When you hit the button to scatter, it gathers all the user inputs as variables and sends them to the scattering function.