by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.0, Creation date: 2016-11-10, Last change: 2025-09-14
See Also: smbAddLine
, smbAddBlock
, smbAddFrameSensor
h=smbAddFrame(FName)
FName: | String with the Tranformation Name |
h: | handle to Block |
smbAddFrame ('Frame 1')
This function, smbAddFrame, is designed to add a Rigid Transformation Block in a SimMechanics model. Below is a detailed explanation of the algorithm and its parameters.
gcs, which stands for "get current system". This is stored in the variable FSys.FName. This is done using sprintf and stored in BName.add_block function. The block is sourced from the SimMechanics library path 'sm_lib/Frames and Transforms/Rigid Transform' and is added with the name BName. The handle to this block is returned as h.nargout==0), the function opens the current system using open(FSys).get_param(gcb,'PortConnectivity'). This provides information about the block's input and output ports.The function is straightforward, focusing on adding a specific type of block to a SimMechanics model and optionally opening the model and displaying port connectivity information.
Algorithm explaination created using ChatGPT on 2025-08-18 22:06. (Please note: No guarantee for the correctness of this explanation)