RAParticleCollection#

class ansys.rocky.app.ra_particle_collection.RAParticleCollection(id: str, model_id: str | None = None)#

Bases: ansys.rocky.app.ra_list.RAList[ansys.rocky.app.ra_particle.RAParticle]

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.

Overview#

GetParticleNames

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

GetParticle

Get a particle given its name.

New

Add a new item. Returns the newly created item.

Import detail#

from ansys.rocky.app.ra_particle_collection import RAParticleCollection

Method detail#

classmethod RAParticleCollection.GetWrappedClass()#
classmethod RAParticleCollection.GetClassName() str#
RAParticleCollection.GetParticleNames() list[str]#

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

Return type:

list

RAParticleCollection.GetParticle(particle_name: str) ansys.rocky.app.ra_particle.RAParticle#

Get a particle given its name.

RAParticleCollection.New() ansys.rocky.app.ra_particle.RAParticle#

Add a new item. Returns the newly created item.