smbFilename

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

returns a temporary filename or directory

Description

The function 'smbNewSystem' creates a temporary directory on the users desktop to collect all temporary STL files that are generated during the design. By calling 'smbFilename' without parameters, the directory name is returned. By calling 'smbFilename' with a filename the full directory path is returned. This functions defines the letters of the temp directory and files.

See Also: smbNewSystem , smbWhich , smbPSLibname , smbPSLibCompile

Example Illustration

 missing image of smbFilename(FName)

Syntax

fn=smbFilename([FName])

Input Parameter

FName: desired Filename

Output Parameter

fn: full path of the desired filename




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, smbFilename, is designed to generate a temporary filename or directory path for use in a SimMechanics environment. It is part of the SolidGeometry library and was created by Tim Lueth.

Input Parameters

Output

Algorithm Steps

  1. Initialize FName 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 FName.
  3. Construct the path using the desktopdir function, the bdroot function, and the FName variable. The path is formatted as '%stmp_%s/%s', where the placeholders are replaced by the desktop directory, the root of the current Simulink model, and the filename, respectively.
  4. If the operating system is Windows (checked using ispc), replace forward slashes with backslashes in the path string.
  5. Return the constructed path as the output fn.
Algorithm explaination created using ChatGPT on 2025-08-19 00: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