Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catia Macro : Replace Component

Status
Not open for further replies.

JorgeT

Mechanical
Joined
Jun 26, 2012
Messages
10
Location
PT
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top