MachineSMMC
Industrial
- May 7, 2004
- 70
Is there anyway to link the save as pdf option in the file --> Save As Pulldown to a button or something to make it a little faster to do?
Thanks
Chris Tellers
Thanks
Chris Tellers
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim SwApp As SldWorks.SldWorks
Dim Model As SldWorks.ModelDoc2
Dim MyPath, ModName, NewName As String
Dim MB As Boolean
Dim Errs As Long
Dim Warnings As Long
' ********************************************************
' Save As Parasolid.swb - Recorded on 02/10/02 by Lee Bell
' Modified for SW2K6 by JB on 3/31/06
' ********************************************************
Sub main()
Set SwApp = Application.SldWorks
' This ensures that there are files loaded in SWX
Set Model = SwApp.ActiveDoc
If Model Is Nothing Then
MB = MsgBox("This routine requires files to be loaded before it is ran" & Chr(13) & _
"Please load a file and run the routine again", vbCritical)
Exit Sub
End
End If
' Use the current directory
MyPath = CurDir
' Or specify the directory you want to use
' Comment out the next line if you want to use the current directory
'MyPath = "C:\Where\Ever\Directory\You\Want\"
ModName = Model.GetTitle
NewName = ModName & ".pdf"
MsgBox "Saving " & NewName & " To" & Chr(13) & MyPath
MB = Model.SaveAs4(MyPath & "\" & NewName, swSaveAsCurrentVersion, swSaveAsOptions_Silent, Errs, Warnings)
If Not MB Then MsgBox "failed!"
Set Model = Nothing
'SwApp.CloseDoc ModName
End Sub