SGTframeselectrename

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Kinematics and Frames
Introduced first in SolidGeometry 5.1, Creation date: 2021-03-20, Last change: 2025-09-15

select frames, rename one, and remove the selected frames that were not renamed

Description

This function use usefull, if functions return several possible Frames of the same type and there is a wish afterwards to select one of those and remove the unused frames
Use it after SGTsetofRLcenter


See Also: SGTframeselect , SGTremove , SGTrename , SGTsetofRLcenter

Example Illustration

 missing image of SGTframeselectrename(SG,Fset,Sel,new)

Syntax

SG=SGTframeselectrename(SG,Fset,Sel,new)

Input Parameter

SG: Solid Geometry
Fset: string selection has to start with
Sel: string selection has to end with
new: New Name for selection

Output Parameter

SG: Solid Geoemtry with a renamed frame




Copyright 2021-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, SGTframeselectrename, is designed to select, rename, and remove frames within a Solid Geometry (SG) object. It is particularly useful when multiple frames of the same type are returned, and there is a need to select one and remove the others.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the new name for the selection using getfuncparams.
  2. Select frames starting with Fset using SGTframeselect.
  3. Select frames ending with Sel using SGTframeselect with a flag for end selection.
  4. Identify frames to remove by finding frames that start with Fset but do not end with Sel.
  5. Retrieve the names of frames to remove using VLofT and SG.Tname.
  6. Identify the frame to rename by finding frames that both start with Fset and end with Sel.
  7. If no frame matches the criteria for renaming, throw an error.
  8. Retrieve the name of the frame to rename.
  9. Log the renaming action using dbprintf.
  10. Remove the identified frames using SGTremove.
  11. Rename the selected frame using SGTrename.
  12. If no output is expected, plot the SG object using SGfigure and SGTplotalpha.
Algorithm explaination created using ChatGPT on 2025-08-19 08:05. (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