This forum has been a huge help in crafting my own export macro. So maybe i can give back a little.
I copied a chuck of macro from a larger macro, this roughly does what you're asking for. it will also export a dxf and step(of the associated part or assembly)
It gets the revision info from the custom properties of the part, so that's not exactly what you're asking. But there's also code to look up the latest revision in a table, so with a little re-work you should be able to get what you need.
I have little programming experience so this might not adhere to best programming practises and being from a larger macro, there are some Dim's that aren't used.
Hope this helps!
Export with Rev - Copy.swp.zip 22.4 KB
If you use SW standard revision tables it will make a custom property with the revision you set in the table too!
Here is the example in the API help for saving a drawing as a PDF:
I believe you should be able to use "Saveas" to save as a JPEG file as well, I've never tried that.
Here is the example to get data from the revision table:
To set your file name just make a string like this:
pdfFile = "C:\Location\" & PartNumber & "-" & Revision & ".pdf"
If you need to pull the part number from custom properties use "Get5".
Check out this post
If you want to search for more go to
Download the excel file and go through some posts on the pdf macros - look under Macros or the API tab