Hello,
I'v been trying to add new component to 3 Product of rootProduct, I do't know how to activate 3 Product. Plese give me some tips, I can't move on with my programming,
Sub CATMain()
Dim oDocuments As Dosuments
Set oDocuments = CATIA.Documents
Dim oProductDocument As Document
Set oProductDocument = oDocuments.Add("Product")
Dim oProduct As Product
Set oProduct = oProductDocument.Product
Dim oProducts As Products
Set oProducts = oProduct.Products
'Add a new products to the collection.
for i=1 to 5
Set oProduct = oProducts.AddNewComponent("CATProduct", ""&i)
next
'activate 3 Product to add new Product to it.
Dim activProduct As Product
set activProduct = CATIA.ActiveDocument.Product.Products.item(3)
'Add new component to Product
Set oProduct3 = activProduct.AddNewComponent("CATProduct", "BD")
'oProduct.item(2).ApplyWorkMode DESIGN_MODE
'set Dok = DokInst.ReferenceProduct.Parent
'activProduct.ApplyWorkMode DESIGN_MODE
End Sub
Best Regards
Santa
I'v been trying to add new component to 3 Product of rootProduct, I do't know how to activate 3 Product. Plese give me some tips, I can't move on with my programming,
Sub CATMain()
Dim oDocuments As Dosuments
Set oDocuments = CATIA.Documents
Dim oProductDocument As Document
Set oProductDocument = oDocuments.Add("Product")
Dim oProduct As Product
Set oProduct = oProductDocument.Product
Dim oProducts As Products
Set oProducts = oProduct.Products
'Add a new products to the collection.
for i=1 to 5
Set oProduct = oProducts.AddNewComponent("CATProduct", ""&i)
next
'activate 3 Product to add new Product to it.
Dim activProduct As Product
set activProduct = CATIA.ActiveDocument.Product.Products.item(3)
'Add new component to Product
Set oProduct3 = activProduct.AddNewComponent("CATProduct", "BD")
'oProduct.item(2).ApplyWorkMode DESIGN_MODE
'set Dok = DokInst.ReferenceProduct.Parent
'activProduct.ApplyWorkMode DESIGN_MODE
End Sub
Best Regards
Santa