Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Define or open each Part in Product tree

Status
Not open for further replies.

Macro2015

Automotive
Joined
Jan 19, 2015
Messages
10
Location
SI
Hello,

I would like to define each part in product tree structure. I can not find the proper result.

Maybe i could do with selection to select each part in product tree and open.
It could be solved with selection.part.item(i) and startcommad(open in new window). Have any idea how to program that. Please check the code below.

Thank you!

'***************************************************

Sub CATMain()

Dim Product As ProductDocument

On Error Resume Next

Set Product = CATIA.ActiveDocument


Dim aProduct As Product
Set aProduct = Product.Product


Set productDocument1 = CATIA.ActiveDocument



Dim selection1 As Selection

Set selection1 = productDocument1.Selection


selection1.Search "CATProductSearch.Part,all"


For X = 1 To selection1.Count

Dim Part As Part
Set myPart = productDocument1.Parts.Item(X)

selection1.Search "CATProductSearch.Part,all"
Set Part = selection1.Item2(X).Value.ReferenceProduct.Parent.Part

MsgBox Part.Name ' DISPALYS PART NAME

' !!!!!!!!!!!!HERE I WOULLD LIKE TO DEFINE THE PART (LIKE DOUBLE CLICK) !!!!!!!!!!
' or open in new window


Next



End Sub

 
Thanks for the links ferdo!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top