add parameters (Grid, Random...) with python I created a script to generate the mesh (spheres, cubes, ...), but I must add parameters existing in the particles menu as Grid, random, ...



are you help me how to add this in my menu panel

How can add the selected  yellow portion  in particles menu to my script is to create different distributions.
After you add your sphere with bpy.ops.mesh.primitive_uv_sphere_add() the new sphere will be the active object which you can get through bpy.context.active_object, you can then add a particle modifier to it and adjust the settings which you can access through the particle modifier.

bpy.ops.mesh.primitive_uv_sphere_add(size = size, location = location)
obj = bpy.context.active_object

ps = obj.modifiers.new(name='particles',type='PARTICLE_SYSTEM')
pset = ps.particle_system.settings

pset.emit_from = 'FACE' # VERT FACE VOLUME
pset.use_emit_random = True
pset.use_even_distribution = True
pset.distribution = 'JIT' # JIT RAND GRID


To adjust other properties you can use the tooltips to find the property name to use -



And if you don't know what values can be used for enumerated options like distribution you can find them in blender's API documentation.