hititfaster
Mechanical
- Nov 24, 2010
- 185
I played about a bit and got to the editor tool, which displays as below, but there doesn't appear to be an instruction to determine colour/B&W. I'd really like to do more with these - they seem like great timesavers...
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
Set swModel = swApp.ActiveDoc
sPathName = swModel.GetPathName 'Get File Name & Path
Extension = Right(sPathName, 6) 'Determine File Type
'Try Again if Not "SLDDRW"
If Extension <> "SLDDRW" Then
MsgBox ("Current Document Is Not .SLDDRW")
End
End If
'Save as PDF
SavePDF:
sPathName = Left(sPathName, Len(sPathName) - 6) 'Remove "SLDDRW" Extension
sPathName = sPathName + "pdf" 'Add "PDF" Extension
Set fso = CreateObject("Scripting.FileSystemObject") 'Check if file exists
If (fso.FileExists(sPathName)) Then 'If file exists
If MsgBox("Overwrite " & sPathName & " ?", vbYesNo) = vbNo Then 'Ask if want to overwrite file
End If
End If
Part.SaveAs2 sPathName, 0, True, False 'Save file if file does not exist or if choose vbYes
End Sub
Dim swApp As Object
Dim Part As Object
Dim SelMgr As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim Feature As Object
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
Set swModel = swApp.ActiveDoc
sPathName = swModel.GetPathName 'Get File Name & Path
Extension = Right(sPathName, 6) 'Determine File Type
'Try Again if Not "SLDDRW"
If Extension <> "SLDDRW" Then
MsgBox ("Current Document Is Not .SLDDRW")
End
End If
'Save as PDF
SavePDF:
sPathName = Left(sPathName, Len(sPathName) - 6) 'Remove "SLDDRW" Extension
sPathName = sPathName + "pdf" 'Add "PDF" Extension
Set fso = CreateObject("Scripting.FileSystemObject") 'Check if file exists
If (fso.FileExists(sPathName)) Then 'If file exists
If MsgBox("Overwrite " & sPathName & " ?", vbYesNo) = vbNo Then 'Ask if want to overwrite file
End If
End If
Part.SaveAs2 sPathName, 0, True, False 'Save file if file does not exist or if choose vbYes
End Sub