smbAddFrame

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

SimMechanics creates a Rigid Transformation Block



See Also: smbAddLine , smbAddBlock , smbAddFrameSensor

Example Illustration

 missing image of smbAddFrame(FName)

Syntax

h=smbAddFrame(FName)

Input Parameter

FName: String with the Tranformation Name

Output Parameter

h: handle to Block

Examples

smbAddFrame ('Frame 1')



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, smbAddFrame, is designed to add a Rigid Transformation Block in a SimMechanics model. Below is a detailed explanation of the algorithm and its parameters.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the current Simulink system using gcs, which stands for "get current system". This is stored in the variable FSys.
  2. Construct the full block name by concatenating the current system name with the provided transformation name FName. This is done using sprintf and stored in BName.
  3. Add a Rigid Transform block to the current system using the 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.
  4. If no output argument is specified (i.e., nargout==0), the function opens the current system using open(FSys).
  5. Retrieve and display the port connectivity of the current block using 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)

Last html export of this page out of FM database by TL: 2025-09-21