These macro’s save a PDF, DXF or AI version of a drawing or STL of a model with the name of the model, in the model folder. Saves tons of time making packages of technical drawings. One-click file-saving! Can be easily changed to save other formats (STEP, IGES, …)
Warning: automatically overwrites existing files!
Download the ZIP package! (33k)
Update 1-2-2016: Since I’m still getting a ton of traffic on this post; I recently tested them with SolidWorks 2016 and they work perfectly.
Like this? You might be interested in my latest project. It's a desk light made completely from a single sheet of printed circuit board. Check it out:

Does your macro run on win 64bit?
Not sure, but probably, yeah. I’m on 2008, so no 64bit back then (I think). Let me know if it does 🙂
Hi, i have checked stl and pdf on 64-bit system (SWX2014) – it runs good… 😀
nice macro – thanx
Hi,
Thanks for sharing these macros. I’m new to using macros and these are working great for me.
Well I’d like to know that How can I use one of these Macros (say PDF) in Solidworks Task Scheduler to automatically save all the drawing files located in a folder to PDF files in the same folder.
Your help is appreciated.
Many thanks in advance!
Best Regards
Ashish Sharma
Hi Ashish,
Good idea. However, I didn’t even know SW had a task scheduler 😀
I’d guess you could feed this macro into the scheduler, but if I remember correctly it only saves a PDF of the currently opened and active file so you might have some trouble with that.
Best regards, Gregor
Can you test this macro on new solidworks?
worked on 2019, which is the latest I have installed
Hi,
Thank you for sharing these macros.
I was having trouble with the one I wrote crashing solidworks when I used it.
Makes everything a lot easier
Hey,
thanks for the macros.
-is it possible to make the .stl macro where i can choose the folder where i can save my file?
-the dxf macro is very nice but it only works on drawing file. can you also make it for a sketch file? i need it for sheet-exhaus transaction
nice greetz from germany
Hi Patrick,
1) Do you want to choose a different path every time? If you want them always in the same folder you can edit the macro quite easily. If you want a pop-up to choose a location then I wouldn’t know how to do that 🙂
2) What do you mean with “sketch file”? A blank SW file with only a sketch?
Hi Patrick,
I would like to save the pdf to a specific folder (always the same) where we put all our pdf. How can I do that.
I was going to reply “Like this!” and then I saw SW returns the full file path in stead of just the filename. This makes it a lot harder to refactor the code. This might help you: http://help.solidworks.com/2016/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.idocumentspecification~filename.html
If I ever need this too I might dive into it and post it here 😉
I just tried this on SW 2021, worked just fine. Thanks so much Gregor!
Yep, still going strong! 🙂