Solidworks API help - saving a part
Solidworks API help - saving a part
(OP)
Hey guys,
Can anyone tell me why this code is not saving my part?
pDirectory = "M:\Solidworks\Tooling\Inspect\" & tooltbx.Text & "\" & tooltbx.Text & ".sldprt"
If MsgBox("Save as " & pDirectory & "?", vbOKCancel, "Confirm Save") = vbOK Then
Part.Extension.SaveAs pDirectory, 0, 2, Nothing, longstatus, longwarnings
If MsgBox("Make a drawing?", vbOKCancel, "Create Drawing?") = vbCancel Then
End
End If
Else
Exit Sub
End If
Can anyone tell me why this code is not saving my part?
pDirectory = "M:\Solidworks\Tooling\Inspect\" & tooltbx.Text & "\" & tooltbx.Text & ".sldprt"
If MsgBox("Save as " & pDirectory & "?", vbOKCancel, "Confirm Save") = vbOK Then
Part.Extension.SaveAs pDirectory, 0, 2, Nothing, longstatus, longwarnings
If MsgBox("Make a drawing?", vbOKCancel, "Create Drawing?") = vbCancel Then
End
End If
Else
Exit Sub
End If






RE: Solidworks API help - saving a part
Can you tell us what sort of thing actually does happen?
-handleman, CSWP (The new, easy test)
RE: Solidworks API help - saving a part
FOLDER = "M:\Solidworks\Tooling\Inspect\" & tooltbx.Text
Set FSO = CreateObject("Scripting.FileSystemObject")
If Not FSO.FolderExists(FOLDER) Then
FSO.createFolder (FOLDER)
End If
pDirectory = "M:\Solidworks\Tooling\Inspect\" & tooltbx.Text & "\" & tooltbx.Text & ".SLDPRT"
If MsgBox("Save as " & pDirectory & "?", vbOKCancel, "Confirm Save") = vbOK Then
Part.SaveAs2 pDirectory, 0, False, False
If MsgBox("Make a drawing?", vbOKCancel, "Create Drawing?") = vbCancel Then
End
End If
Else
Exit Sub
End If