RAMotionFrame#

class ansys.rocky.app.motion.ra_motion_frame.RAMotionFrame(id, model_id=None)#

Bases: ansys.rocky.app.motion.ra_base_motion.RABaseMotionFrame, ansys.rocky.app.ra_grid_process_element.RAGridProcessElementItem, ansys.rocky.app._ra_orientation_mixin._RAOrientationMixin

Rocky PrePost Scripting wrapper for a motion frame.

The class contains methods to configure a motion frame and its motions. There are some options to retrieve a specific RAMotionFrame in a project from a RAStudy, a RAMotionFrameSource or another RAMotionFrame:

# From the RAStudy
motion_frame = study.GetElement('')

# From the RAMotionFrameSource
frame_source = study.GetMotionFrameSource()
motion_frame = frame_source.GetMotionFrame('')

# From a "parent" motion frame
frame_1 = study.GetElement('')
frame_2 = frame_1.GetMotionFrame('')

A motion frame comprises frame properties (relative position, rotation angle, free body limits, etc) and a list of motions. The properties are manipulated via direct Get*() and Set*() methods, while the motions are accessed separately via the list returned by GetMotions().

Motion frames can be created on the “root” of the project’s motion frames (the source returned in RAStudy.GetMotionFrameSource()), or as a ‘child’ frame of a pre-existing motion frame:

frame_source = study.GetMotionFrameSource()

# Create a motion frame with no parent frame
frame_1 = frame_source.NewFrame()
# Configure this new frame frame_1
frame_1.SetRelativePosition(...)
frame_1.SetEnablePeriodicMotion(...)
# ... configure motions, etc.

# Create a new frame, as a child of `frame_1`
frame_2 = frame_1.NewFrame()
# Configure this new frame frame_2
frame_2.SetRelativePosition(...)
# ... configure motions, etc.

Overview#

AddFreeBodyTranslationMotion

Adds a free body translation motion to the frame.

AddFreeBodyRotationMotion

Adds a free body rotation motion to the frame.

AddPendulumMotion

Adds a pendulum motion to the frame.

AddVibrationMotion

Adds a vibration motion to the frame.

AddRotationMotion

Adds a rotation motion to the frame.

AddTranslationMotion

Adds a translation motion to the frame.

ApplyTo

Link this motion frame to the given geometry.

GetMotions

Get the list of motions in the motion frame.

GetFbmMaxAngularLimits

Get the value of “Fbm Max Angular Limits”.

SetFbmMaxAngularLimits

Set the values of “Fbm Max Angular Limits”.

GetFbmMaxLinearLimits

Get the value of “Fbm Max Linear Limits”.

SetFbmMaxLinearLimits

Set the values of “Fbm Max Linear Limits”.

GetFbmMinAngularLimits

Get the value of “Fbm Min Angular Limits”.

SetFbmMinAngularLimits

Set the values of “Fbm Min Angular Limits”.

GetFbmMinLinearLimits

Get the value of “Fbm Min Linear Limits”.

SetFbmMinLinearLimits

Set the values of “Fbm Min Linear Limits”.

GetEnableFbmAngularLimits

Get the value of “Enable Fbm Angular Limits”.

SetEnableFbmAngularLimits

Set the value of “Enable Fbm Angular Limits”.

GetEnableFbmLinearLimits

Get the value of “Enable Fbm Linear Limits”.

SetEnableFbmLinearLimits

Set the value of “Enable Fbm Linear Limits”.

GetEnablePeriodicMotion

Get the value of “Enable Periodic Motion”.

SetEnablePeriodicMotion

Set the value of “Enable Periodic Motion”.

GetKeepInPlace

Get the value of “Keep In Place”.

SetKeepInPlace

Set the value of “Keep In Place”.

GetName

Get the value of “Name”.

SetName

Set the value of “Name”.

GetPeriodicMotionPeriod

Get the value of “Periodic Motion Period”.

SetPeriodicMotionPeriod

Set the value of “Periodic Motion Period”.

GetPeriodicMotionStartTime

Get the value of “Periodic Motion Start Time”.

SetPeriodicMotionStartTime

Set the value of “Periodic Motion Start Time”.

GetPeriodicMotionStopTime

Get the value of “Periodic Motion Stop Time”.

SetPeriodicMotionStopTime

Set the value of “Periodic Motion Stop Time”.

GetRelativePosition

Get the value of “Relative Position”.

SetRelativePosition

Set the values of “Relative Position”.

Import detail#

from ansys.rocky.app.motion.ra_motion_frame import RAMotionFrame

Method detail#

classmethod RAMotionFrame.GetWrappedClass()#
classmethod RAMotionFrame.GetClassName() str#
RAMotionFrame.AddFreeBodyTranslationMotion(motion_direction: str = 'none') ansys.rocky.app.motion.ra_motion.RAMotion#

Adds a free body translation motion to the frame.

Parameters:

motion_direction – The motion direction string. It can be one of the followings: [‘none’, ‘x’, ‘y’, ‘xy’, ‘z’, ‘xz’, ‘yz’, ‘xyz’]

Returns:

Returns the RAMotion created.

RAMotionFrame.AddFreeBodyRotationMotion(motion_direction: str = 'none') ansys.rocky.app.motion.ra_motion.RAMotion#

Adds a free body rotation motion to the frame.

Parameters:

motion_direction – The motion direction string. It can be one of the followings: [‘none’, ‘x’, ‘y’, ‘xy’, ‘z’, ‘xz’, ‘yz’, ‘xyz’]

Returns:

Returns the RAMotion created.

RAMotionFrame.AddPendulumMotion(start_time=(0.0, 's'), stop_time=(1000.0, 's'), initial_frequency=(0.0, 'Hz'), angular_initial_amplitude=(0.0, 'rad'), direction=((0.0, 0.0, 0.0), 'm'), angular_initial_phase=(0.0, 'rad'), frequency_variation=(0.0, 'Hz/s'), angular_amplitude_variation=(0.0, 'rad/s'))#

Adds a pendulum motion to the frame.

Parameters:
  • start_time (float) – The start time for the motion.

  • stop_time (float) – The end time for the motion.

  • initial_frequency (float) – The initial frequency of the rotation (in Hz).

  • angular_initial_amplitude (float) – The initial angular amplitude of the rotation (in rad).

  • direction (list(float)) – The direction of the rotation (in m).

  • angular_initial_phase (list(float)) – The initial angular phase of the rotation (in rad).

  • frequency_variation (float) – The variation of the frequency (in Hz/s).

  • angular_amplitude_variation (float) – The angular amplitude variation (in rad/s).

RAMotionFrame.AddVibrationMotion(start_time=(0.0, 's'), stop_time=(1000.0, 's'), initial_frequency=(0.0, 'Hz'), initial_amplitude=(0.0, 'm'), direction=((0.0, 0.0, 0.0), 'm'), frequency_variation=(0.0, 'Hz/s'), amplitude_variation=(0.0, 'm/s'))#

Adds a vibration motion to the frame.

Parameters:
  • start_time (float) – The start time for the motion.

  • stop_time (float) – The end time for the motion.

  • initial_frequency (float) – The initial frequency of the vibration (in Hz).

  • initial_amplitude (float) – The initial amplitude of the vibration (in m).

  • direction (list(float)) – The direction of the vibration (in m).

  • frequency_variation (float) – The variation of the frequency (in Hz/s).

  • amplitude_variation (float) – The amplitude variation (in m/s).

RAMotionFrame.AddRotationMotion(start_time=(0.0, 's'), stop_time=(1000.0, 's'), angular_velocity=((0.0, 0.0, 0.0), 'rad/s'), angular_acceleration=((0.0, 0.0, 0.0), 'rad/s2'))#

Adds a rotation motion to the frame.

Parameters:
  • start_time (float) – The start time for the motion.

  • stop_time (float) – The end time for the motion.

  • angular_velocity (list(float)) – The motion angular velocity (x, y, z).

  • angular_acceleration (list(float)) – The motion angular acceleration (x, y, z).

Return RAMotion:

Returns the motion created.

RAMotionFrame.AddTranslationMotion(start_time=(0.0, 's'), stop_time=(1000.0, 's'), velocity=((0.0, 0.0, 0.0), 'm/s'), acceleration=((0.0, 0.0, 0.0), 'm/s2'), define_as: str = 'fixed_velocity', final_velocity=((0.0, 0.0, 0.0), 'm/s'))#

Adds a translation motion to the frame.

Parameters:
  • start_time (float) – The start time for the motion.

  • stop_time (float) – The end time for the motion.

  • velocity (list(float,float,float)) – The motion velocity (x, y, z) in m/s.

  • acceleration (list(float,float,float)) – The motion acceleration (x, y, z) in m/s2

  • displace_geometry (bool) – Whether the geometry should be displaced with the movement or not.

  • define_as (unicode) –

    How it should be defined. Valid values are:

    ’fixed_velocity’ ‘initial_and_final_velocity’ ‘initial_velocity_and_acceleration’

  • final_velocity (list(float,float,float)) –

    The final motion velocity (x, y, z) in m/2.

    Used only if define_as == ‘initial_and_final_velocity’, in which case the initial velocity is given by the velocity parameter.

Return RAMotion:

Returns the motion created.

RAMotionFrame.ApplyTo(obj) None#

Link this motion frame to the given geometry.

Parameters:

obj (Subject|ScriptingWrapper) – Either the actual object or the wrapper in the scripting for the object.

RAMotionFrame.GetMotions() ansys.rocky.app.motion.ra_motion_list.RAMotionList#

Get the list of motions in the motion frame.

Returns:

Returns a list with the motions configured.

RAMotionFrame.GetFbmMaxAngularLimits(unit: str | None = None) list[float]#

Get the value of “Fbm Max Angular Limits”.

Parameters:

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

RAMotionFrame.SetFbmMaxAngularLimits(values: collections.abc.Sequence[str | float], unit: str | None = None) None#

Set the values of “Fbm Max Angular Limits”.

Parameters:
  • values – The values to set. The values can be heterogeneous, the element of values can be an expression with input variables or a float. Must have exactly 3 elements.

  • unit – The unit for values. If no unit is provided, values is assumed to be in “dega”.

Raises:

RockyApiError – If values doesn’t have exactly 3 elements.

RAMotionFrame.GetFbmMaxLinearLimits(unit: str | None = None) list[float]#

Get the value of “Fbm Max Linear Limits”.

Parameters:

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

RAMotionFrame.SetFbmMaxLinearLimits(values: collections.abc.Sequence[str | float], unit: str | None = None) None#

Set the values of “Fbm Max Linear Limits”.

Parameters:
  • values – The values to set. The values can be heterogeneous, the element of values can be an expression with input variables or a float. Must have exactly 3 elements.

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

Raises:

RockyApiError – If values doesn’t have exactly 3 elements.

RAMotionFrame.GetFbmMinAngularLimits(unit: str | None = None) list[float]#

Get the value of “Fbm Min Angular Limits”.

Parameters:

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

RAMotionFrame.SetFbmMinAngularLimits(values: collections.abc.Sequence[str | float], unit: str | None = None) None#

Set the values of “Fbm Min Angular Limits”.

Parameters:
  • values – The values to set. The values can be heterogeneous, the element of values can be an expression with input variables or a float. Must have exactly 3 elements.

  • unit – The unit for values. If no unit is provided, values is assumed to be in “dega”.

Raises:

RockyApiError – If values doesn’t have exactly 3 elements.

RAMotionFrame.GetFbmMinLinearLimits(unit: str | None = None) list[float]#

Get the value of “Fbm Min Linear Limits”.

Parameters:

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

RAMotionFrame.SetFbmMinLinearLimits(values: collections.abc.Sequence[str | float], unit: str | None = None) None#

Set the values of “Fbm Min Linear Limits”.

Parameters:
  • values – The values to set. The values can be heterogeneous, the element of values can be an expression with input variables or a float. Must have exactly 3 elements.

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

Raises:

RockyApiError – If values doesn’t have exactly 3 elements.

RAMotionFrame.GetEnableFbmAngularLimits() bool#

Get the value of “Enable Fbm Angular Limits”.

RAMotionFrame.SetEnableFbmAngularLimits(value: bool) None#

Set the value of “Enable Fbm Angular Limits”.

Parameters:

value – The value to set.

RAMotionFrame.GetEnableFbmLinearLimits() bool#

Get the value of “Enable Fbm Linear Limits”.

RAMotionFrame.SetEnableFbmLinearLimits(value: bool) None#

Set the value of “Enable Fbm Linear Limits”.

Parameters:

value – The value to set.

RAMotionFrame.GetEnablePeriodicMotion() bool#

Get the value of “Enable Periodic Motion”.

RAMotionFrame.SetEnablePeriodicMotion(value: bool) None#

Set the value of “Enable Periodic Motion”.

Parameters:

value – The value to set.

RAMotionFrame.GetKeepInPlace() int#

Get the value of “Keep In Place”.

RAMotionFrame.SetKeepInPlace(value: str | int) None#

Set the value of “Keep In Place”.

Parameters:

value – The value to set. This value can be an expression with input variables or int type.

RAMotionFrame.GetName() str#

Get the value of “Name”.

RAMotionFrame.SetName(value: str) None#

Set the value of “Name”.

Parameters:

value – The value to set.

RAMotionFrame.GetPeriodicMotionPeriod(unit: str | None = None) float#

Get the value of “Periodic Motion Period”.

Parameters:

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

RAMotionFrame.SetPeriodicMotionPeriod(value: str | float, unit: str | None = None) None#

Set the value of “Periodic Motion Period”.

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

RAMotionFrame.GetPeriodicMotionStartTime(unit: str | None = None) float#

Get the value of “Periodic Motion Start Time”.

Parameters:

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

RAMotionFrame.SetPeriodicMotionStartTime(value: str | float, unit: str | None = None) None#

Set the value of “Periodic Motion 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”.

RAMotionFrame.GetPeriodicMotionStopTime(unit: str | None = None) float#

Get the value of “Periodic Motion Stop Time”.

Parameters:

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

RAMotionFrame.SetPeriodicMotionStopTime(value: str | float, unit: str | None = None) None#

Set the value of “Periodic Motion 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”.

RAMotionFrame.GetRelativePosition(unit: str | None = None) list[float]#

Get the value of “Relative Position”.

Parameters:

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

RAMotionFrame.SetRelativePosition(values: collections.abc.Sequence[str | float], unit: str | None = None) None#

Set the values of “Relative Position”.

Parameters:
  • values – The values to set. The values can be heterogeneous, the element of values can be an expression with input variables or a float. Must have exactly 3 elements.

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

Raises:

RockyApiError – If values doesn’t have exactly 3 elements.