by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Kinematics and Frames
Introduced first in SolidGeometry 5.0, Creation date: 2020-09-06, Last change: 2025-09-14
See Also: SGTremove
, SGTset
, SGTget
, SGTsetofFS
SG=SGTrename(SG,Norg,Nnew,[rm]);
SG: | Solid geometry | |
Norg: | Original name | |
Nnew: | New name | |
rm: | if true; existing frame Nnew is deleted first; default is false |
SG: | Solid geometry with changed frame name |
B=SGbox
B=SGTrename(B,'B','C')
B=SGTrename(B,'C','B')
B=SGTrename(B,'B','F')
B=SGTrename(B,'B','F',true)
This function, SGTrename, is designed to rename a frame within a solid geometry object. It is part of the SG-Library and was introduced in SolidGeometry 5.0.
Nnew will be deleted before renaming. The default value is false.rm parameter using getfuncparams. If not provided, default to false.Nnew in SG.Tname.Norg in SG.Tname. If not found, throw an error indicating the frame does not exist.Nnew already exists:rm is false, throw an error indicating the frame already exists.rm is true, call SGTremove to remove the existing frame with the name Nnew.SG.Tname at the index of Norg to Nnew.nargout==0), plot the solid geometry using SGfigure and SGTplotalpha.The function can be used as follows:
B = SGbox; B = SGTrename(B, 'B', 'C'); B = SGTrename(B, 'C', 'B'); B = SGTrename(B, 'B', 'F'); B = SGTrename(B, 'B', 'F', true);
In these examples, a solid geometry object B is created and its frame names are changed using SGTrename.