gcsb

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

get current system's block

Description

returns current system's block
gcs ==> return the full path of the current system
bdroot or bdroot(gcs) ==> return the root of the current system
gcb ==> returns the current block path
gcsb returns the block name in the current window-tab-system

See Also:

Example Illustration

 missing image of gcsb(bl)

Syntax

s=gcsb([bl])

Input Parameter

bl: block; default is gcb

Output Parameter

s: name of block




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, gcsb, is designed to return the name of a block within the current system in Simulink. It is part of the SimMechanics library and was created by Tim Lueth on December 26, 2016. The function primarily interacts with Simulink's current system and block functions.

Input Parameters

Output

Algorithm Steps

  1. Initialize the variable bl with the current block using gcb.
  2. Check if there is at least one input argument and if it is not empty. If so, set bl to the first input argument.
  3. Use strrep to remove the current system path from bl. This is done by replacing the current system path, obtained using gcs, with an empty string.
  4. Replace any newline characters in the block name with a space using strrep.
  5. Return the processed block name as s.
Algorithm explaination created using ChatGPT on 2025-08-18 22:33. (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