SGcmd

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Parametric Design
Introduced first in SolidGeometry 5.2, Creation date: 2022-06-26, Last change: 2025-09-15

Shortcut for SGofCPLcommand but supports also sprintftext format

Description

if the 1st argument is a cell, sprintftext is used to process the 1st argument

See Also: SGofCPLcommand , sprintftext

Example Illustration

 missing image of SGcmd(par)

Syntax

[SG,CPLO,warn,ocstr,macrol,STAT]=SGcmd([par])

Input Parameter

par: see SGofCPLcommand

Output Parameter

SG: see SGofCPLcommand
CPLO: see SGofCPLcommand
warn: see SGofCPLcommand
ocstr: see SGofCPLcommand
macrol: see SGofCPLcommand
STAT: SGofCPLcommand

Examples


SGcmd('b 23 19 , h 1.5, enter, b 1.5 19,h 25, dups 3 1 1 10, rel center, rel aligntop -0.1, cat'); % STRING FORMAT

SGcmd({'b 23 19 , h 1.5, enter, b 1.5 19,h 25, dups ',[3 1 1 10],', rel center, rel aligntop -0.1, cat'}); CELL FORMAT ==> sprintftext




Copyright 2022-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, SGcmd, is a shortcut for the SGofCPLcommand function and supports the sprintftext format. It was developed by Tim Lueth and is part of the VLFL-Lib, introduced in SolidGeometry 5.2.

Input Parameters

Output Results

Function Workflow

The function begins by checking if the first argument is a cell array. If it is, it processes the cell array using sprintftext to convert it into a string format. This allows for dynamic text formatting and command generation.

If no output arguments are specified, the function calls SGofCPLcommand with the provided arguments and assigns the result to the variable ans in the caller's workspace. This is useful for quick command execution without needing to capture the output explicitly.

If output arguments are specified, the function calls SGofCPLcommand and returns the results in the specified output variables: SG, CPLO, warn, ocstr, macrol, and STAT.

Example Usage

The function can be used in two formats:

Algorithm explaination created using ChatGPT on 2025-08-19 06:50. (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