Hello,
I'm trying to write a macro to do "Generate CATPart from Product" then save the new part:
****
current_prod.Selection.Add current_prod.Product '
CATIA.StartCommand "Generate CATPart from Product"
CATIA.RefreshDisplay = True
For i = 1 To 100
SendKeys "{DELETE}"
Next i
SendKeys "NewPartName"
SendKeys "{ENTER}"
Sleep (7000) ' already declared : Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
CATIA.ActiveDocument.SaveAs current_prod.Path & "\NewCatPart"
****
As result , I have :
current_prod was saved in : current_prod.Path & "\NewCatPart"
the window "Generate CATPart from Product" displayed.
If i delete the two last lines of code, the generation works
Any help please ?
I'm trying to write a macro to do "Generate CATPart from Product" then save the new part:
****
current_prod.Selection.Add current_prod.Product '
CATIA.StartCommand "Generate CATPart from Product"
CATIA.RefreshDisplay = True
For i = 1 To 100
SendKeys "{DELETE}"
Next i
SendKeys "NewPartName"
SendKeys "{ENTER}"
Sleep (7000) ' already declared : Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
CATIA.ActiveDocument.SaveAs current_prod.Path & "\NewCatPart"
****
As result , I have :
current_prod was saved in : current_prod.Path & "\NewCatPart"
the window "Generate CATPart from Product" displayed.
If i delete the two last lines of code, the generation works
Any help please ?