Hi Friends,
I have written a code for renaming all part's name and instance inside a product.
For eg. if it is part1(part1.1), part2(part2.2)
it will change the number and instance to say vik1(vik1.1),vik2(vik2.2)
I have just started with automation, need suggestion, wht other things i can add or change to make it better.
PFB the code.
*************************
Sub CATMain()
Dim iCount As Integer
Dim sPoint As String
sPoint = "."
Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument
Dim product1 As Product
Set product1 = productDocument1.Product
Dim products1 As Products
Set products1 = product1.Products
For iCount = 1 To products1.Count
products1.Item(iCount).PartNumber = "vikas" & iCount
products1.Item(iCount).Name = products1.Item(iCount).PartNumber & sPoint & iCount
Next iCount
End Sub
****************************************************************************
All suggestion and comments are welcome.
Thanks.
I have written a code for renaming all part's name and instance inside a product.
For eg. if it is part1(part1.1), part2(part2.2)
it will change the number and instance to say vik1(vik1.1),vik2(vik2.2)
I have just started with automation, need suggestion, wht other things i can add or change to make it better.
PFB the code.
*************************
Sub CATMain()
Dim iCount As Integer
Dim sPoint As String
sPoint = "."
Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument
Dim product1 As Product
Set product1 = productDocument1.Product
Dim products1 As Products
Set products1 = product1.Products
For iCount = 1 To products1.Count
products1.Item(iCount).PartNumber = "vikas" & iCount
products1.Item(iCount).Name = products1.Item(iCount).PartNumber & sPoint & iCount
Next iCount
End Sub
****************************************************************************
All suggestion and comments are welcome.
Thanks.