Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Find object with same name as selected object

Status
Not open for further replies.

TheKyle9

Mechanical
Oct 1, 2015
14
US
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

Capture_yrqvn9.jpg
 
Replies continue below

Recommended for you

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"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top