suleymanyaman
Industrial
Hi I have some code and also I am new.I want to ask a questıon.The codes in below how can I get part name of product (ıt meanscurrent_prod.ReferenceProduct.Parent.Name) in an array?
Can you help me please?Thank you.
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
If InStr(CATIA.ActiveDocument.Name, ".CATProduct") < 1 Then
MsgBox "Active CATIA Document is not a Product. Open a Product file and run this script again.", , msgboxtext
Exit Sub
End If
Call ListingNames(productDocument1.Product)
End Sub
Sub ListingNames(current_prod)
Dim partName As String
partName = InputBox("Please Enter the Filename")
If current_prod.Products.Count > 0 Then
For i = 1 To current_prod.Products.Count
Call ListingNames(current_prod.Products.Item(i))
'MsgBox current_prod.Products.Item(i).Name
Next i
Else
If partName = current_prod.ReferenceProduct.Parent.Name Then
MsgBox "succesful"
Else
MsgBox "try again"
End If
MsgBox current_prod.ReferenceProduct.Parent.Name
End If
End Sub
Can you help me please?Thank you.
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
If InStr(CATIA.ActiveDocument.Name, ".CATProduct") < 1 Then
MsgBox "Active CATIA Document is not a Product. Open a Product file and run this script again.", , msgboxtext
Exit Sub
End If
Call ListingNames(productDocument1.Product)
End Sub
Sub ListingNames(current_prod)
Dim partName As String
partName = InputBox("Please Enter the Filename")
If current_prod.Products.Count > 0 Then
For i = 1 To current_prod.Products.Count
Call ListingNames(current_prod.Products.Item(i))
'MsgBox current_prod.Products.Item(i).Name
Next i
Else
If partName = current_prod.ReferenceProduct.Parent.Name Then
MsgBox "succesful"
Else
MsgBox "try again"
End If
MsgBox current_prod.ReferenceProduct.Parent.Name
End If
End Sub