RASpringDashpotForce#

class ansys.rocky.app.motion.ra_spring_dashpot_force.RASpringDashpotForce(id: str, model_id: str | None = None)#

Bases: ansys.rocky.app.api_element_item.ApiElementItem

Rocky PrePost Scripting wrapper representing a Spring-Dashpot Force motion.

Retrieve this specific wrapper after setting the correct motion type on a RAMotion. For example:

motions = motion_frame.GetMotions()
motion_1 = motions.New()
motion_1.SetType('Spring-Dashpot Force')
spring_force = motion_1.GetTypeObject()

Overview#

GetDashpotCoefficient

Get the value of “Dashpot Coefficient”.

SetDashpotCoefficient

Set the value of “Dashpot Coefficient”.

GetDirection

Get “Direction” as a string.

SetDirection

Set the value of “Direction”.

GetValidDirectionValues

Get a list of all possible values for “Direction”.

GetSpringCoefficient

Get the value of “Spring Coefficient”.

SetSpringCoefficient

Set the value of “Spring Coefficient”.

Import detail#

from ansys.rocky.app.motion.ra_spring_dashpot_force import RASpringDashpotForce

Method detail#

classmethod RASpringDashpotForce.GetWrappedClass()#
classmethod RASpringDashpotForce.GetClassName()#
RASpringDashpotForce.GetDashpotCoefficient(unit: str | None = None) float#

Get the value of “Dashpot Coefficient”.

Parameters:

unit – The unit for the returned value. If no unit is provided, the returned value will be in “N.s/m”.

RASpringDashpotForce.SetDashpotCoefficient(value: str | float, unit: str | None = None) None#

Set the value of “Dashpot Coefficient”.

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

  • unit – The unit for value. If no unit is provided, value is assumed to be in “N.s/m”.

RASpringDashpotForce.GetDirection() str#

Get “Direction” as a string.

Returns:

The returned value will be one of [‘none’, ‘x’, ‘y’, ‘xy’, ‘z’, ‘xz’, ‘yz’, ‘xyz’].

RASpringDashpotForce.SetDirection(value: str) None#

Set the value of “Direction”.

Parameters:

value – The value to set. Must be one of [‘none’, ‘x’, ‘y’, ‘xy’, ‘z’, ‘xz’, ‘yz’, ‘xyz’].

Raises:

RockyApiError – If value is not a valid “Direction” option.

RASpringDashpotForce.GetValidDirectionValues() list[str]#

Get a list of all possible values for “Direction”.

Returns:

The returned list is [‘none’, ‘x’, ‘y’, ‘xy’, ‘z’, ‘xz’, ‘yz’, ‘xyz’].

RASpringDashpotForce.GetSpringCoefficient(unit: str | None = None) float#

Get the value of “Spring Coefficient”.

Parameters:

unit – The unit for the returned value. If no unit is provided, the returned value will be in “N/m”.

RASpringDashpotForce.SetSpringCoefficient(value: str | float, unit: str | None = None) None#

Set the value of “Spring Coefficient”.

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

  • unit – The unit for value. If no unit is provided, value is assumed to be in “N/m”.