RAMotion#
- class ansys.rocky.app.motion.ra_motion.RAMotion(id: str, model_id: str | None = None)#
Bases:
ansys.rocky.app.api_element_item.ApiElementItemRocky 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
RAMotioncontains 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 viaGetTypeObject()after the specific motion type is configured viaSetType().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:
RATranslationRARotationRAPendulumRAVibrationRAFreeBodyRotationRAFreeBodyTranslationRAPrescribedForceRAPrescribedMomentRASpringDashpotForceRASpringDashpotMomentRALinearTimeVariableForceRALinearTimeVariableMomentRATimeSeriesTranslationRATimeSeriesRotation
Overview#
Set the concrete type of motion. |
|
Get the concrete type of motion. |
|
Get the API object that wraps the specific motion type. |
|
Return a list with the possible values for the motion’s type. |
|
Get the value of “Start Time”. |
|
Set the value of “Start Time”. |
|
Get the value of “Stop Time”. |
|
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:
- 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”.