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
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