tpalsl125
Automotive
- Apr 24, 2015
- 44
Hello all,
I made the script to make Existing Component with Do ... Loop.
This can make just first time and after can't make it and pop up the errors.
Here is my script. Could you tell me where it is wrong?
I made the script to make Existing Component with Do ... Loop.
This can make just first time and after can't make it and pop up the errors.
Here is my script. Could you tell me where it is wrong?
Code:
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
Set product1 = productDocument1.Product
Set products1 = product1.Products
Do
Dim arrayOfVariantOfBSTR1(0)
arrayOfVariantOfBSTR1(0) = "C:\tmp\Part1.CATPart"
products1.AddComponentsFromFiles arrayOfVariantOfBSTR1, "All"
AskMsgBox = MsgBox("Whould you like to do once more?", vbYesNo, "Question")
Loop Until AskMsgBox = vbNo
End Sub