Skip to main content

Rocky PrePost scripting 2024 R2

RASizeDistributionList

Last update: 17.07.2025

class RASizeDistributionList

Rocky PrePost Scripting wrapper to manipulate the size properties in a single Particle.

To get the RASizeDistributionList from a RAParticle, use:

size_distribution_list = particle.GetSizeDistributionList()

RASizeDistributionList contains methods to set the size type and add, remove and retrieve individual size distribution entries. It corresponds to the items on a Particle’s “Size” tab on the Rocky UI.

The following examples add, remove and access individual entries in the size distribution list:

# Add new items
size_distribution = size_distribution_list.New()

# Access and modify items
size_distribution = size_distribution_list[0]
size_distribution.SetSize(1.0, 'm')

# Remove items
size_distribution_list.Remove(size_distribution)
del size_distribution_list[0]
size_distribution_list.Clear()

Note that this list is used even if the configured particle only has a single size, such as when it is composed of Multiple Elements. In these cases, the single size refers to the first item on the list (and no other items are used).

The RASizeDistributionList is a list of RASizeDistribution.

Methods:

Name Description
Clear() Remove all items from the list.
GetCgmScaleFactor() Get the value of "Cgm Scale Factor".
GetSizeType() Get "Size Type" as a string.
GetValidSizeTypeValues() Get a list of all possible values for "Size Type".
New() Add a new item.
Remove(item) Remove an item from the list.
SetCgmScaleFactor(value) Set the value of "Cgm Scale Factor".
SetSizeType(value) Set the value of "Size Type".

Clear()

Remove all items from the list.

GetCgmScaleFactor()

Get the value of “Cgm Scale Factor”.

GetSizeType()

Get “Size Type” as a string.

  • Returns: The returned value will be one of [‘sieve’, ‘equivalent_diameter’, ‘original_size_scale’].

GetValidSizeTypeValues()

Get a list of all possible values for “Size Type”.

  • Returns: The returned list is [‘sieve’, ‘equivalent_diameter’, ‘original_size_scale’].

New()

Add a new item. Returns the newly created item.

Remove(item: T)

Remove an item from the list.

SetCgmScaleFactor(value: Union[str, float])

Set the value of “Cgm Scale Factor”.

  • Parameters: value – The value to set. This value can be an expression with input variables or float type.

SetSizeType(value: str)

Set the value of “Size Type”.

  • Parameters: value – The value to set. Must be one of [‘sieve’, ‘equivalent_diameter’, ‘original_size_scale’].
  • Raises: RockyApiError – If value is not a valid “Size Type” option.

Connect with Ansys