:class:`RAMotionFrame` ====================== .. py:class:: ansys.rocky.app.motion.ra_motion_frame.RAMotionFrame(id, model_id=None) Bases: :py:obj:`ansys.rocky.app.motion.ra_base_motion.RABaseMotionFrame`, :py:obj:`ansys.rocky.app.ra_grid_process_element.RAGridProcessElementItem`, :py:obj:`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 :class:`RAMotionFrame` in a project from a :class:`RAStudy`, a :class:`RAMotionFrameSource` or another :class:`RAMotionFrame`: .. code-block:: python # 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 :meth:`GetMotions()`. Motion frames can be created on the "root" of the project's motion frames (the source returned in :meth:`RAStudy.GetMotionFrameSource()`), or as a 'child' frame of a pre-existing motion frame: .. code-block:: python 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. .. !! processed by numpydoc !! .. py:currentmodule:: RAMotionFrame Overview -------- .. tab-set:: .. tab-item:: Constructors .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~GetWrappedClass` - * - :py:attr:`~GetClassName` - .. tab-item:: Methods .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~AddFreeBodyTranslationMotion` - Adds a free body translation motion to the frame. * - :py:attr:`~AddFreeBodyRotationMotion` - Adds a free body rotation motion to the frame. * - :py:attr:`~AddPendulumMotion` - Adds a pendulum motion to the frame. * - :py:attr:`~AddVibrationMotion` - Adds a vibration motion to the frame. * - :py:attr:`~AddRotationMotion` - Adds a rotation motion to the frame. * - :py:attr:`~AddTranslationMotion` - Adds a translation motion to the frame. * - :py:attr:`~ApplyTo` - Link this motion frame to the given geometry. * - :py:attr:`~GetMotions` - Get the list of motions in the motion frame. * - :py:attr:`~GetFbmMaxAngularLimits` - Get the value of "Fbm Max Angular Limits". * - :py:attr:`~SetFbmMaxAngularLimits` - Set the values of "Fbm Max Angular Limits". * - :py:attr:`~GetFbmMaxLinearLimits` - Get the value of "Fbm Max Linear Limits". * - :py:attr:`~SetFbmMaxLinearLimits` - Set the values of "Fbm Max Linear Limits". * - :py:attr:`~GetFbmMinAngularLimits` - Get the value of "Fbm Min Angular Limits". * - :py:attr:`~SetFbmMinAngularLimits` - Set the values of "Fbm Min Angular Limits". * - :py:attr:`~GetFbmMinLinearLimits` - Get the value of "Fbm Min Linear Limits". * - :py:attr:`~SetFbmMinLinearLimits` - Set the values of "Fbm Min Linear Limits". * - :py:attr:`~GetEnableFbmAngularLimits` - Get the value of "Enable Fbm Angular Limits". * - :py:attr:`~SetEnableFbmAngularLimits` - Set the value of "Enable Fbm Angular Limits". * - :py:attr:`~GetEnableFbmLinearLimits` - Get the value of "Enable Fbm Linear Limits". * - :py:attr:`~SetEnableFbmLinearLimits` - Set the value of "Enable Fbm Linear Limits". * - :py:attr:`~GetEnablePeriodicMotion` - Get the value of "Enable Periodic Motion". * - :py:attr:`~SetEnablePeriodicMotion` - Set the value of "Enable Periodic Motion". * - :py:attr:`~GetKeepInPlace` - Get the value of "Keep In Place". * - :py:attr:`~SetKeepInPlace` - Set the value of "Keep In Place". * - :py:attr:`~GetName` - Get the value of "Name". * - :py:attr:`~SetName` - Set the value of "Name". * - :py:attr:`~GetPeriodicMotionPeriod` - Get the value of "Periodic Motion Period". * - :py:attr:`~SetPeriodicMotionPeriod` - Set the value of "Periodic Motion Period". * - :py:attr:`~GetPeriodicMotionStartTime` - Get the value of "Periodic Motion Start Time". * - :py:attr:`~SetPeriodicMotionStartTime` - Set the value of "Periodic Motion Start Time". * - :py:attr:`~GetPeriodicMotionStopTime` - Get the value of "Periodic Motion Stop Time". * - :py:attr:`~SetPeriodicMotionStopTime` - Set the value of "Periodic Motion Stop Time". * - :py:attr:`~GetRelativePosition` - Get the value of "Relative Position". * - :py:attr:`~SetRelativePosition` - Set the values of "Relative Position". Import detail ------------- .. code-block:: python from ansys.rocky.app.motion.ra_motion_frame import RAMotionFrame Method detail ------------- .. py:method:: GetWrappedClass() :classmethod: .. py:method:: GetClassName() -> str :classmethod: .. py:method:: AddFreeBodyTranslationMotion(motion_direction: str = 'none') -> ansys.rocky.app.motion.ra_motion.RAMotion Adds a free body translation motion to the frame. :param motion_direction: The motion direction string. It can be one of the followings: ['none', 'x', 'y', 'xy', 'z', 'xz', 'yz', 'xyz'] :return: Returns the RAMotion created. .. !! processed by numpydoc !! .. py:method:: AddFreeBodyRotationMotion(motion_direction: str = 'none') -> ansys.rocky.app.motion.ra_motion.RAMotion Adds a free body rotation motion to the frame. :param motion_direction: The motion direction string. It can be one of the followings: ['none', 'x', 'y', 'xy', 'z', 'xz', 'yz', 'xyz'] :return: Returns the RAMotion created. .. !! processed by numpydoc !! .. py:method:: 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. :param float start_time: The start time for the motion. :param float stop_time: The end time for the motion. :param float initial_frequency: The initial frequency of the rotation (in Hz). :param float angular_initial_amplitude: The initial angular amplitude of the rotation (in rad). :param list(float) direction: The direction of the rotation (in m). :param list(float) angular_initial_phase: The initial angular phase of the rotation (in rad). :param float frequency_variation: The variation of the frequency (in Hz/s). :param float angular_amplitude_variation: The angular amplitude variation (in rad/s). .. !! processed by numpydoc !! .. py:method:: 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. :param float start_time: The start time for the motion. :param float stop_time: The end time for the motion. :param float initial_frequency: The initial frequency of the vibration (in Hz). :param float initial_amplitude: The initial amplitude of the vibration (in m). :param list(float) direction: The direction of the vibration (in m). :param float frequency_variation: The variation of the frequency (in Hz/s). :param float amplitude_variation: The amplitude variation (in m/s). .. !! processed by numpydoc !! .. py:method:: 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. :param float start_time: The start time for the motion. :param float stop_time: The end time for the motion. :param list(float) angular_velocity: The motion angular velocity (x, y, z). :param list(float) angular_acceleration: The motion angular acceleration (x, y, z). :return RAMotion: Returns the motion created. .. !! processed by numpydoc !! .. py:method:: 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. :param float start_time: The start time for the motion. :param float stop_time: The end time for the motion. :param list(float,float,float) velocity: The motion velocity (x, y, z) in m/s. :param list(float,float,float) acceleration: The motion acceleration (x, y, z) in m/s2 :param bool displace_geometry: Whether the geometry should be displaced with the movement or not. :param unicode define_as: How it should be defined. Valid values are: 'fixed_velocity' 'initial_and_final_velocity' 'initial_velocity_and_acceleration' :param list(float,float,float) final_velocity: 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. .. !! processed by numpydoc !! .. py:method:: ApplyTo(obj) -> None Link this motion frame to the given geometry. :param Subject|ScriptingWrapper obj: Either the actual object or the wrapper in the scripting for the object. .. !! processed by numpydoc !! .. py:method:: GetMotions() -> ansys.rocky.app.motion.ra_motion_list.RAMotionList Get the list of motions in the motion frame. :return: Returns a list with the motions configured. .. !! processed by numpydoc !! .. py:method:: GetFbmMaxAngularLimits(unit: str | None = None) -> list[float] Get the value of "Fbm Max Angular Limits". :param unit: The unit for the returned values. If no unit is provided, the returned values will be in "dega". .. !! processed by numpydoc !! .. py:method:: SetFbmMaxAngularLimits(values: collections.abc.Sequence[str | float], unit: str | None = None) -> None Set the values of "Fbm Max Angular Limits". :param 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. :param 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. .. !! processed by numpydoc !! .. py:method:: GetFbmMaxLinearLimits(unit: str | None = None) -> list[float] Get the value of "Fbm Max Linear Limits". :param unit: The unit for the returned values. If no unit is provided, the returned values will be in "m". .. !! processed by numpydoc !! .. py:method:: SetFbmMaxLinearLimits(values: collections.abc.Sequence[str | float], unit: str | None = None) -> None Set the values of "Fbm Max Linear Limits". :param 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. :param 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. .. !! processed by numpydoc !! .. py:method:: GetFbmMinAngularLimits(unit: str | None = None) -> list[float] Get the value of "Fbm Min Angular Limits". :param unit: The unit for the returned values. If no unit is provided, the returned values will be in "dega". .. !! processed by numpydoc !! .. py:method:: SetFbmMinAngularLimits(values: collections.abc.Sequence[str | float], unit: str | None = None) -> None Set the values of "Fbm Min Angular Limits". :param 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. :param 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. .. !! processed by numpydoc !! .. py:method:: GetFbmMinLinearLimits(unit: str | None = None) -> list[float] Get the value of "Fbm Min Linear Limits". :param unit: The unit for the returned values. If no unit is provided, the returned values will be in "m". .. !! processed by numpydoc !! .. py:method:: SetFbmMinLinearLimits(values: collections.abc.Sequence[str | float], unit: str | None = None) -> None Set the values of "Fbm Min Linear Limits". :param 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. :param 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. .. !! processed by numpydoc !! .. py:method:: GetEnableFbmAngularLimits() -> bool Get the value of "Enable Fbm Angular Limits". .. !! processed by numpydoc !! .. py:method:: SetEnableFbmAngularLimits(value: bool) -> None Set the value of "Enable Fbm Angular Limits". :param value: The value to set. .. !! processed by numpydoc !! .. py:method:: GetEnableFbmLinearLimits() -> bool Get the value of "Enable Fbm Linear Limits". .. !! processed by numpydoc !! .. py:method:: SetEnableFbmLinearLimits(value: bool) -> None Set the value of "Enable Fbm Linear Limits". :param value: The value to set. .. !! processed by numpydoc !! .. py:method:: GetEnablePeriodicMotion() -> bool Get the value of "Enable Periodic Motion". .. !! processed by numpydoc !! .. py:method:: SetEnablePeriodicMotion(value: bool) -> None Set the value of "Enable Periodic Motion". :param value: The value to set. .. !! processed by numpydoc !! .. py:method:: GetKeepInPlace() -> int Get the value of "Keep In Place". .. !! processed by numpydoc !! .. py:method:: SetKeepInPlace(value: str | int) -> None Set the value of "Keep In Place". :param value: The value to set. This value can be an expression with input variables or int type. .. !! processed by numpydoc !! .. py:method:: GetName() -> str Get the value of "Name". .. !! processed by numpydoc !! .. py:method:: SetName(value: str) -> None Set the value of "Name". :param value: The value to set. .. !! processed by numpydoc !! .. py:method:: GetPeriodicMotionPeriod(unit: str | None = None) -> float Get the value of "Periodic Motion Period". :param unit: The unit for the returned value. If no unit is provided, the returned value will be in "s". .. !! processed by numpydoc !! .. py:method:: SetPeriodicMotionPeriod(value: str | float, unit: str | None = None) -> None Set the value of "Periodic Motion Period". :param value: The value to set. This value can be an expression with input variables or float type. :param unit: The unit for `value`. If no unit is provided, `value` is assumed to be in "s". .. !! processed by numpydoc !! .. py:method:: GetPeriodicMotionStartTime(unit: str | None = None) -> float Get the value of "Periodic Motion Start Time". :param unit: The unit for the returned value. If no unit is provided, the returned value will be in "s". .. !! processed by numpydoc !! .. py:method:: SetPeriodicMotionStartTime(value: str | float, unit: str | None = None) -> None Set the value of "Periodic Motion Start Time". :param value: The value to set. This value can be an expression with input variables or float type. :param unit: The unit for `value`. If no unit is provided, `value` is assumed to be in "s". .. !! processed by numpydoc !! .. py:method:: GetPeriodicMotionStopTime(unit: str | None = None) -> float Get the value of "Periodic Motion Stop Time". :param unit: The unit for the returned value. If no unit is provided, the returned value will be in "s". .. !! processed by numpydoc !! .. py:method:: SetPeriodicMotionStopTime(value: str | float, unit: str | None = None) -> None Set the value of "Periodic Motion Stop Time". :param value: The value to set. This value can be an expression with input variables or float type. :param unit: The unit for `value`. If no unit is provided, `value` is assumed to be in "s". .. !! processed by numpydoc !! .. py:method:: GetRelativePosition(unit: str | None = None) -> list[float] Get the value of "Relative Position". :param unit: The unit for the returned values. If no unit is provided, the returned values will be in "m". .. !! processed by numpydoc !! .. py:method:: SetRelativePosition(values: collections.abc.Sequence[str | float], unit: str | None = None) -> None Set the values of "Relative Position". :param 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. :param 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. .. !! processed by numpydoc !!