This content has been marked as final. Show 12 replies
The Task Scheduler, look here; see the screenshot below.
If you find it, Run the Task; Export, .pdf.
Task Scheduler.JPG 150.7 KB
Last spring, someone posted a macro that did this (actually, two people and two macros). I cannot seem to find those threads, however.
The task scheduler method is great if you have SW Office Premium, for us without it, you will have to find that macro.
I suggest searching in the API category of these forums, there was a solution that was posted. I'm sorry I can't be of more help; maybe someone else kept a copy. Or even better, the original poster is still around.
Thanks a bunch guys.
We don't have the Office Premium, so it looks like I'll get to open and save as a whole bunch of drawings.
I did find where someone have posted part of a vb file asking for help with a problem, but couldn't find anything more.
I'll try searching again.
Thanks for your help.
This website has a batch conversion program that works very well. It's main use is for batch printing, but I've also used it for other format conversions. The cost is $70 per license which I thought was reasonable considered all the program does.
Take a look here...
See if this helps out.
Basically the question was asked:
Is there a way of selecting a directory in a SolidWorks macro?
I want the user to select a directory batch open and save a pdf copy to another directory. I can do every thing but the directory part.
I have done a similar prog in excel with the getfileopen method but SW doesent have this.
The only option left is to use SW working directory but I don't like this.
'This module contains all the declarations to use the
'Windows 95 Shell API to use the browse for folders
'dialog box. To use the browse for folders dialog box,
'please call the BrowseForFolders function using the
'For contacting information, see other module
Public Type BrowseInfo
hwndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
Public Const BIF_RETURNONLYFSDIRS = 1
Public Const MAX_PATH = 260
Public Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long)
Public Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
Public Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Public Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
Public Function BrowseForFolder(hwndOwner As Long, sPrompt As String) As String
'declare variables to be used
Dim iNull As Integer
Dim lpIDList As Long
Dim lResult As Long
Dim sPath As String
Dim udtBI As BrowseInfo
.hwndOwner = hwndOwner
.lpszTitle = lstrcat(sPrompt, "")
.ulFlags = BIF_RETURNONLYFSDIRS
'Call the browse for folder API
lpIDList = SHBrowseForFolder(udtBI)
'get the resulting string path
If lpIDList Then
sPath = String$(MAX_PATH, 0)
lResult = SHGetPathFromIDList(lpIDList, sPath)
iNull = InStr(sPath, vbNullChar)
If iNull Then sPath = Left$(sPath, iNull - 1)
'If cancel was pressed, sPath = ""
BrowseForFolder = sPath
'sample usage in form
Private Sub cmdServerBrowse_Click()
txtDatabasePath.Text = BrowseForFolder(me.hwnd, "Please select a Server folder.")
Google swBatchPrint and you can print to a PDF through Bluebeam in SolidWorks itself.
I use SWupBB to save all drawings as PDF automatically (very handy tool)
so with this if you could get a macro to open-save-close then the SWupBB would make the PDF's for you
P.S. I will work through a method and put it on the wiki at my site soon.
Batch Export - Export multiple files at once. PDF, JPEG, Print, DWG (relatively new in this application still needs work), change color. This macro requires you change where files are located. Be sure to go through and make changes before executing this macro.
Here is a link to a website which ahs th ebest macro I've found for doing this. it will batch convert a drawing file to a variety of formats. Very simple, very easy.
We use Bluebeam for batch pdf conversions. We've found it to be a pretty good tool for batch pdf's and also has an included program called Revu that lets you do some basic pdf editing and markup, also very handy. Bluebeam works as a SolidWorks plugin but also installs a pdf printer engine so you can create pdf's from any of your other programs as well. There is a cost involved, however, something like $150 per seat w/volume discounts available.
By the way, my understanding is that Bluebeam is no longer the pdf converter used by SolidWorks when doing a save as pdf. Minor point I know but I think they made the switch in SW20006 or SW2007.
Hey folks...here is a little trick I found. I always test our installs before full deployment for compatibilty issues and the like. When I install, I pick everything even though I have a license for SolidWorks core version only. Guess what...the Task Scheduler installs too. However, I didn't see an option to export to PDF but it does appear I have all other functionality. Hope this helped someone.
I have SW Professional which includes Task Scheduler and there are actually (2) ways to create pdf's. If you go to Tasks/Export, under Export file type it lists pdf or if you have Adobe Distiller you can use the Print Files selection and then select Adobe pdf for your printer.