Syntax
fn=smbFilename([FName])
Input Parameter
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
- FName: This is an optional input parameter. It represents the desired filename. If provided, the function will return the full path to this file within a temporary directory. If not provided, the function will return the path to the temporary directory itself.
Output
- fn: This is the output of the function. It is a string representing the full path of the desired filename or the temporary directory.
Algorithm Steps
- Initialize
FName
as an empty string.
- Check if there is at least one input argument and if the first argument is not empty. If so, assign this argument to
FName
.
- 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.
- If the operating system is Windows (checked using
ispc
), replace forward slashes with backslashes in the path string.
- 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