Skip to main content

Rocky PrePost scripting 2026 R1

RAParticleCollection

Last update: 23.02.2026

class RAParticleCollection

Rocky PrePost Scripting wrapper for the collection of particles in a project.

This wrapper corresponds to the “Particles” item in the project’s data tree. To retrieve the RAParticleCollection from a RAStudy, use:

particle_collection = study.GetParticleCollection()

Instances of the RAParticleCollection class act as regular Python lists, and can be iterated on, accessed via index, etc:

particle_1 = particle_collection.New()
particle_2 = particle_collection[1]
del particle_collection[0]
for particle in particle_collection:
    particle.SetMaterial('My Particle Material')

Items in this list are of type RAParticle.

Methods:

Name Description
Clear() Remove all items from the list.
GetParticle(particle_name) Get a particle given its name.
GetParticleNames() Get a list of the names of all the particles in this collection.
New() Add a new item.
Remove(item) Remove an item from the list.

Clear()

Remove all items from the list.

GetParticle(particle_name: str)

Get a particle given its name.

GetParticleNames()

Get a list of the names of all the particles in this collection.

  • Return type: list

New()

Add a new item. Returns the newly created item.

Remove(item: T)

Remove an item from the list.

Connect with Ansys