I don't understand why I cannot add products and rename them using below code:
It works once, I delete the new created product and after that it does not work anymore.
Using below code it works but it is not what I need.
I need this type of product:
instead of this one:
What am I doing wrong?
Code:
Sub CATMain()
Dim TopNodeDoc As Document
Set TopNodeDoc = CATIA.ActiveDocument
Dim TopNode As Product
Set TopNode = TopNodeDoc.Product
Dim newNode As Product
Set newNode = TopNode.Products.AddNewComponent("Product","")
newNode.Name = "test1"
newNode.PartNumber = "test2"
End Sub
It works once, I delete the new created product and after that it does not work anymore.
Using below code it works but it is not what I need.
Code:
Set newNode = TopNode.Products.AddNewProduct("Product")
I need this type of product:
instead of this one:
What am I doing wrong?