Syntax
smbSGtransP(SGName,delta)
Input Parameter
SGName : | | Solid Name that has Baseframe and Follower Frame |
delta : | | Delta vector |
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 algorithm is designed to move a Solid Geometry (SG) in a SimMechanics model without altering its structure. The function smbSGtransP
takes two input parameters: SGName
and delta
.
Input Parameters
- SGName: The name of the solid that contains both a Baseframe and a Follower Frame.
- delta: A vector representing the translation offset to be applied to the SG.
Algorithm Steps
- Retrieve the current Simulink model using
find_system(gcs)
, which returns all blocks in the current system.
- Identify the block associated with the Baseframe of the SG by searching for
SGName.B
in the list of blocks.
- Get the current translation offset of the Baseframe using
get_param
with the parameter 'TranslationCartesianOffset'
.
- Convert the retrieved offset from a string to a numeric vector using
str2num
.
- Add the
delta
vector to the current offset to compute the new position.
- Format the new position as a string using
sprintf
and update the block's parameter with set_param
.
- Repeat steps 2-6 for the Follower Frame by searching for
SGName.F
.
Algorithm explaination created using ChatGPT on 2025-08-18 22:40. (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