You are on page 1of 1

Sub CATMain()

Dim oProdDoc As ProductDocument


Set oProdDoc = CATIA.ActiveDocument
Dim oRootProd As Product
Set oRootProd = oProdDoc.Product
A = 0
Dim par As Parameters
Set par = oRootProd.UserRefProperties
Dim SinexRef As String
Call WalkDownTree(oRootProd, A)
End Sub
Sub WalkDownTree(oInProduct As Product, B)
Dim k As Integer
Dim oInstances As Products
Set oInstances = oInProduct.Products
If B <> 0 Then
MsgBox oInProduct.ReferenceProduct.PartNumber
End If
For k = 1 To oInstances.Count
Dim oInst As Product
Set oInst = oInstances.Item(k)
Call WalkDownTree(oInst, k)
Next
End Sub

You might also like