llbbyy
Mechanical
- Mar 21, 2017
- 21
I creat a macro( see bellow) to save selected part to a specified Path but failed. any help will be appreciated.
''''''''''''''''''''
Language = "VBScript"
CATIA.DisplayFileAlerts = False
sub CATMain()
Set cad = CATIA.ActiveDocument
Set sel = cad.Selection
Set prod = cad.Product.Products
Set docs = CATIA.Documents
If sel.count =0 Then
MsgBox "Select parts from tree.", ,msgboxtext
Exit Sub
End If
docPath=InputBox("Enter the Path:")
for i=1 to sel.count
set doc1= docs.item(i)
doc1.saveas docPath & prod.item(i).PartNumber &".CatPart" 'failed here
next
End sub
''''''''''''''''''''
Language = "VBScript"
CATIA.DisplayFileAlerts = False
sub CATMain()
Set cad = CATIA.ActiveDocument
Set sel = cad.Selection
Set prod = cad.Product.Products
Set docs = CATIA.Documents
If sel.count =0 Then
MsgBox "Select parts from tree.", ,msgboxtext
Exit Sub
End If
docPath=InputBox("Enter the Path:")
for i=1 to sel.count
set doc1= docs.item(i)
doc1.saveas docPath & prod.item(i).PartNumber &".CatPart" 'failed here
next
End sub