×
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

Find object with same name as selected object

Find object with same name as selected object

Find object with same name as selected object

(OP)
Hi guys,

I am still muddling thru... everything scripting related. hopefully this is an easy one...

What:
I attempted to create a simple script to select all parts with the same name as the one selected by the user.
I'm pretty sure I'm screwing up the way it searches. Any suggestions how make this work? (See image, orange is selected by user, and once script is run, the highlighted one will select also. however, if any part is selected, it will only highlight other parts with the same name)

why:
I am going to use this search module as part of a greater script to eventually change colors (as a few of you helped me before, tho I'm still in the works regarding that matter)


Thank you in advance for your support.
-Kyle







RE: Find object with same name as selected object

I didn't test this...

'Preselect your part instance
Dim oSelection
Set oSelection = CATIA.ActiveDocument.Selection

Dim sNumber
sNumber = oSelection.item(1).value.name

oSelection.Clear
oSelection.search "Name =" & sNumber & ", all"

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