Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro_searching a Geo Set item by name - help

Status
Not open for further replies.

l3obAero

Aerospace
Jan 23, 2009
13
0
0
US
I have a script that finds a Geo Set by a certain name, and proceeds to extract information from that set. The problem I discovered is that the code - 'Set Level1 = OriginPart.HybridBodies.Item("Fasteners")' will actually find the first set with the string "Fasteners" in the name; such as "Upper_Fasteners_Bolts". Since it is finding the first occurance of the string "Fasteners" in the name, I my not get to the Set I'm looking for. I have added code to catch when the set is not correct by name; however, I have not figured out how to move on past that 'false set'
Is there a way to make it find just the set that is called "Fasteners" and ignore sets with the string "Fasteners" within a longer name?
Or,.... is there a way to make it proceed past that 'false item' and move on to the next occurance of "Fasteners" in a name? If I go back to search the item name again in the script, it just finds the first occurance in the tree again....
 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top