Syntax
smbSetTranslationVector(BName,t)
Input Parameter
BName : | | Block Name or gcb |
t : | | Translation Vector (x y z) |
Copyright 2016-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, smbSetTranslationVector
, is designed to set a translation vector for a block in a SimMechanics model. It is part of the SolidGeometry library and was modified in 2023 to accommodate changes in the SIMScape interface.
Input Parameters
- BName: The name of the block or the current block context (gcb).
- t: A translation vector represented as a 3-element array [x, y, z] in millimeters.
Algorithm Steps
- The function begins by setting the translation method of the current block to 'Cartesian' using the
set_param
function.
- It checks the MATLAB release version. If the release is earlier than R2023a, it sets the translation length unit to 'mm'. Otherwise, it sets the translation Cartesian offset units to 'mm'.
- The translation vector
t
is formatted into a string representation suitable for the SimMechanics block parameter using sprintf
.
- The formatted translation vector is then applied to the block's 'TranslationCartesianOffset' parameter using
set_param
.
Algorithm explaination created using ChatGPT on 2025-08-18 23:52. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21