smbPSLibCompile

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-08-18

compiles the PS Library in the current smbPSLibname



See Also: smbNewSystem , smbWhich , smbFilename , smbPSLibname

Example Illustration

 missing image of smbPSLibCompile

Syntax

smbPSLibCompile




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, smbPSLibCompile, is designed to compile a PS Library in the current directory. It is part of the SolidGeometry library and was introduced in version 3.2. The function does not take any input parameters and operates based on the current working directory and specific library paths.

Steps in the Algorithm:

  1. Store Current Directory: The function begins by storing the current working directory in the variable adir using the pwd command.
  2. Get PS Library Name: It retrieves the name of the PS Library by calling the function smbPSLibname and stores it in the variable psdir.
  3. Change Directory: The function changes the current directory to the one returned by smbFilename using the cd command.
  4. Build the Library: It calls the ssc_build function with a specific substring of psdir. This substring is extracted by finding the position of the '+' character in psdir and taking the part of the string from the character after '+' to the second last character.
  5. Check and Add Path: The function checks if the path returned by smbFilename is already in the MATLAB path using ispath. If not, it adds this path using addpath.
  6. Return to Original Directory: Finally, the function changes back to the original directory stored in adir.

Key Functions Used:

Algorithm explaination created using ChatGPT on 2025-08-18 22:18. (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