smbPSBlockname

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.2, Creation date: 2016-12-25, Last change: 2025-09-14

return the name of a block realtive to Library

Description

search for "Rotational Friction Force"
smbPSLibname = "/Users/lueth/Desktop/tmp_SG_LIB_EXP_23/+mechPS_Tim_Lueth/Rotational Friction Force"
smbPSBlockname = "mechPS_Tim_Lueth_lib/Rotational Friction Force"

See Also: smbPSBlockname , smbPSLibname

Example Illustration

 missing image of smbPSBlockname(block)

Syntax

bn=smbPSBlockname(block)

Input Parameter

block: block description

Output Parameter

bn: Block path




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, smbPSBlockname, is designed to return the name of a block relative to a library in the SG-Library. It was created by Tim Lueth and is part of the SIMMECHANICS class.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize the variable block as an empty string.
  2. Check if there is at least one input argument and if the first argument is not empty. If so, assign this argument to block.
  3. Call the function smbPSLibname to get the library path and store it in variable a.
  4. Use the strfind function to locate the position of the character '+' in the string a and store the result in b.
  5. Extract the substring from a starting from the position after '+' to the second last character and store it in bn.
  6. Concatenate bn with the string '_lib/' and the block variable to form the final block path.
Algorithm explaination created using ChatGPT on 2025-08-18 23:15. (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