RAMotion#

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

Bases: ansys.rocky.app.api_element_item.ApiElementItem

Rocky PrePost Scripting wrapper representing a single Motion in a Motion Frame.

Access individual motions via a RAMotionFrame’s motion list:

motions = motion_frame.GetMotions()
motion_1 = motions[0]
motion_2 = motions.New()

Every RAMotion contains properties that are common to all motions (such as start and stop times) and properties that are specific to the motion’s type (translation, vibration, etc). These latter properties must be accessed by a “sub-object” that is retrieved via GetTypeObject() after the specific motion type is configured via SetType().

motions = motion_frame.GetMotions()
motion_1 = motions.New()
motion_1.SetType('Translation')
translation = motion_1.GetTypeObject()
# `translation` is a RATranslation
translation.SetVelocity([1.0, 0.0, 0.0], 'm/s')

Refer to the specific PrePost Scripting wrappers for documentation on the individual motion types:

  • RATranslation

  • RARotation

  • RAPendulum

  • RAVibration

  • RAFreeBodyRotation

  • RAFreeBodyTranslation

  • RAPrescribedForce

  • RAPrescribedMoment

  • RASpringDashpotForce

  • RASpringDashpotMoment

  • RALinearTimeVariableForce

  • RALinearTimeVariableMoment

  • RATimeSeriesTranslation

  • RATimeSeriesRotation

Overview#

SetType

Set the concrete type of motion.

GetType

Get the concrete type of motion.

GetTypeObject

Get the API object that wraps the specific motion type.

GetValidTypes

Return a list with the possible values for the motion’s type.

GetStartTime

Get the value of “Start Time”.

SetStartTime

Set the value of “Start Time”.

GetStopTime

Get the value of “Stop Time”.

SetStopTime

Set the value of “Stop Time”.

Import detail#

from ansys.rocky.app.motion.ra_motion import RAMotion

Method detail#

classmethod RAMotion.GetWrappedClass()#
classmethod RAMotion.GetClassName()#
RAMotion.SetType(motion_type)#

Set the concrete type of motion.

Parameters:

motion_type (unicode) – The concrete motion type. Accepted values are the strings in the “Type” drop-down menu in the UI.

Returns:

The PrePost Scripting wrapper representing the concrete motion type.

RAMotion.GetType()#

Get the concrete type of motion.

Return type:

unicode

Returns:

A string describing the type of motion. The returned value will be one of the strings in the “Type” drop-down menu in the UI.

RAMotion.GetTypeObject()#

Get the API object that wraps the specific motion type.

Return type:

ApiElementItem

RAMotion.GetValidTypes()#

Return a list with the possible values for the motion’s type.

Return type:

list(unicode)

Returns:

A list of accepted values for SetType().

RAMotion.GetStartTime(unit: str | None = None) float#

Get the value of “Start Time”.

Parameters:

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

RAMotion.SetStartTime(value: str | float, unit: str | None = None) None#

Set the value of “Start Time”.

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 “s”.

RAMotion.GetStopTime(unit: str | None = None) float#

Get the value of “Stop Time”.

Parameters:

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

RAMotion.SetStopTime(value: str | float, unit: str | None = None) None#

Set the value of “Stop Time”.

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 “s”.