×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Macro_searching a Geo Set item by name - help

Macro_searching a Geo Set item by name - help

Macro_searching a Geo Set item by name - help

(OP)
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....

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources