Skip to main content

Rocky PrePost scripting 2026 R1

RACurve

Last update: 23.02.2026

class RACurve

Methods:

Name Description
CrossFromAbove(threshold[, result]) Returns the domain values where y crosses some threshold from above X's where.
CrossFromBellow(threshold[, result]) Returns the domain values where y crosses some threshold from bellow X's where.
GetStatistics() @return: IStatistics
GetTimeSet() @return: ITimeSet
GetUnit() @return: unicode
GetX() @return: list(float) or ITimeSet)
GetXUnit() @return: unicode
GetY() @return: list(float or ITimeStep)
Interpolate(x_value) Returns the piecewise linear interpolation with given value at discrete data-points.
Reset() Reset all changes to its default values
SetFrequency(days[, extend]) Change the domain frequency
SetUnit(unit) Change the unit of the curve image values (y)
SetXUnit(unit) Change the unit of the curve image values (y)

Attributes:

Name Description
curve_name @return: unicode
element_name @return: unicode
simulation_name @return: unicode
unit @return: unicode
x @return: list(float) or ITimeSet)
x_unit @return: unicode
y @return: list(float or ITimeStep)

CrossFromAbove(threshold, result=None)

Returns the domain values where y crosses some threshold from above X’s where:

y[i-1]>threshold and y[i]=threshold

@param threshold: float : The threshold value in the image

@param result: ‘left’, ‘right’ or ‘interp’ : Which result should be returned ‘left’ will return the x value on the left side of the interval ‘right’ will return the x value on the right side of the interval ‘interp’ will return the x value of the linear interpolation of the interval

@note: If no result type is given an interpolation will be used

@return: list(float or TimeStep) : A list of the domain values

CrossFromBellow(threshold, result=None)

Returns the domain values where y crosses some threshold from bellow X’s where:

y[i-1]<threshold and>=threshold

@param threshold: float : The threshold value in the image

@param result: ‘left’, ‘right’ or ‘interp’ : Which result should be returned ‘left’ will return the x value on the left side of the interval ‘right’ will return the x value on the right side of the interval ‘interp’ will return the x value of the linear interpolation of the interval

@note: If no result type is given an interpolation will be used

@return: list(float or TimeStep) : A list of the domain values

GetStatistics()

@return: IStatistics : An object will the curve statistics information.

@note: Usage : #Minimum value statistics.min
#Maximum value statistics.max
#Sum of all the values statistics.sum
#Sum squared of all the values statistics.sum_squared
#Average of the values statistics.average
#Variance of the values statistics.variance
#Standard deviation of the values statistics.standard_deviation

GetTimeSet()

@return: ITimeSet : The time set domain

GetUnit()

@return: unicode : The unit of the curve image values (y)

GetX()

@return: list(float) or ITimeSet) : The list of values associated with the domain If a different unit is defined a conversion will take place

GetXUnit()

@return: unicode : The unit of the curve image values (y)

GetY()

@return: list(float or ITimeStep) : The list of values associated with the domain If a different unit is defined a conversion will take place

Interpolate(x_value)

Returns the piecewise linear interpolation with given value at discrete data-points.

@param x_value: float, tuple or TimeStep : A float defining the elapsed time-step in days A tuple with the year, month, day and optionally the hour and minutes Or a TimeStep

Reset()

Reset all changes to its default values

SetFrequency(days, extend=None)

Change the domain frequency

@param days: float : The frequency in days

@param extend: bool, optional : If a last value should be included even if outisde the domain

SetUnit(unit)

Change the unit of the curve image values (y)

@param unit: unicode : The unit to be set

SetXUnit(unit)

Change the unit of the curve image values (y)

@param unit: unicode : The unit to be set

property curve_name

@return: unicode : The name of the element associated to this curve

property element_name

@return: unicode : The name of the element associated to this curve

property simulation_name

@return: unicode : The name of the element associated to this curve

property unit

@return: unicode : The unit of the curve image values (y)

property x

@return: list(float) or ITimeSet) : The list of values associated with the domain If a different unit is defined a conversion will take place

property x_unit

@return: unicode : The unit of the curve image values (y)

property y

@return: list(float or ITimeStep) : The list of values associated with the domain If a different unit is defined a conversion will take place

Connect with Ansys