JorgeT
Mechanical
- Jun 26, 2012
- 10
Hello to all,
I record an macro (below) to replace one component, but only work with the part names used to record de macro.
It's possible to change the macro to run with other parts by select them in tree ?
My scripting skills are very poor, so any help is very welcome
Thanks in advance.
Jorge
Code:
Language="VBSCRIPT"
Sub CATMain()
Dim productDocument1 As Document
Set productDocument1 = CATIA.ActiveDocument
Dim product1 As Product
Set product1 = productDocument1.Product
Dim products1 As Products
Set products1 = product1.Products
Dim product2 As Product
Set product2 = products1.Item("gPA08_1.1")
Set product2 = products1.ReplaceComponent(product2, "D:\Moldes\22-2674\3d-Molde\gPA07.CATPart", False)
End Sub
I record an macro (below) to replace one component, but only work with the part names used to record de macro.
It's possible to change the macro to run with other parts by select them in tree ?
My scripting skills are very poor, so any help is very welcome
Thanks in advance.
Jorge
Code:
Language="VBSCRIPT"
Sub CATMain()
Dim productDocument1 As Document
Set productDocument1 = CATIA.ActiveDocument
Dim product1 As Product
Set product1 = productDocument1.Product
Dim products1 As Products
Set products1 = product1.Products
Dim product2 As Product
Set product2 = products1.Item("gPA08_1.1")
Set product2 = products1.ReplaceComponent(product2, "D:\Moldes\22-2674\3d-Molde\gPA07.CATPart", False)
End Sub