What is the correct context for applying a new particle setting or override it? I have an object (a feather) with a particle system on it (little objects that turn into spaces later - boolean/difference - to make it look a little ruffled). I have duplicated the object a number of times (to create a wing). Each instance gives me the same particle system output. To randomize the particles on each duplicated object, I give it a new particle setting and change the seed value.

To be able to do this a large number of times (and many other things as well), I am creating  code to automate the tasks. 

Problem: the particle settings line bpy.ops.particle.new() gives me "#RuntimeError: Operator bpy.ops.particle.new.poll() failed, context is incorrect"

I am new to coding and learning fast. Dove in the documentation and read the Q&amp;A's on this site, but hit a dead end. I am out of my depth here. Help is appreciated. 

I know there is a "Button context" called "bpy.context.particle_settings", but I don't know what to do with that. 

What context do I need to apply new particle settings to work (and how)? or how can I override the context? 

In the snipped below one edge of the feather, containing the particle system, is selected and made active, before attempting to add new settings

bpy.ops.object.select_all(action='DESELECT')
object = bpy.data.objects[edge_name]
object.select = True
bpy.context.scene.objects.active = bpy.data.objects[edge_name]
bpy.ops.particle.new() #RuntimeError: Operator bpy.ops.particle.new.poll() failed, context is incorrect 
bpy.context.object.particle_systems["ParticleSystem"].seed = seed_value
The bpy.ops.particle.new() is not the operator name you are after.

bpy.context.scene.objects.active = bpy.data.objects[edge_name]
bpy.ops.object.particle_system_add()
bpy.context.object.particle_systems.active.seed = seed_value


It is usually preferred to not use operators in scripts. For creating particle systems the method may appear a bit odd as adding a modifier seems to be the only non-operator way to do it. You might notice that this way doesn't need to alter the active or selected objects.

object = bpy.data.objects[edge_name]

if len(object.particle_systems) == 0:
    object.modifiers.new(name='particles',type='PARTICLE_SYSTEM')
    object.particle_systems.active.seed = seed_value


Once you have the particle system on the object you can either change each setting to suit or you can set it to use an existing particle setup.

object.particle_systems[0].settings = bpy.data.particles['MyGreatParticles']


While a new particle setting will be created each time you add a particle modifier and you will get more of them as you repeat this, by using an existing particle setup they will have zero user count and will not be saved to disk.