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
[SG,CPLO,warn,ocstr,macrol,STAT]=SGcmd([par])
par: | see SGofCPLcommand |
SG: | see SGofCPLcommand | |
CPLO: | see SGofCPLcommand | |
warn: | see SGofCPLcommand | |
ocstr: | see SGofCPLcommand | |
macrol: | see SGofCPLcommand | |
STAT: | SGofCPLcommand |
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
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.
SGofCPLcommand function. If the first argument is a cell array, the function uses sprintftext to process it.SGofCPLcommand.SGofCPLcommand.SGofCPLcommand.SGofCPLcommand.SGofCPLcommand.SGofCPLcommand.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.
The function can be used in two formats:
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');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'}); This format uses sprintftext for processing.