I seem to be struggling with getting and setting text in a GTol frame (VBA). I'm wanting to check for a certain text string (prefix) on a geometric tolerance in a drawing and remove that prefix if found while leaving the remainder of any existing text unchanged. I understand and can successfully loop through the text items in a GTol frame with GetTextAtIndex, but am at a loss when setting the text. I'm using SetText, but this takes a position from the swGTolTextParts_e Enumeration. Why can the position in SetText not be set based on the same index that was retrieved from GetTextAtIndex? I ran a simple example and the index from GetTextAtIndex does not match up with the numbers in the swGTolTextParts_e Enumeration.
In short, is there a way to relate the index from GetTextAtIndex to the enumeration used inSetText?
I'm on 2016 and am referencing the following API examples.