I work at a company in a transition between two programs. At the moment we are generating every .PDF and .DWG manually. To make this easier i started making a macro to make the process faster and automated. Problem is that i am stuck.

You can use the attached macro to save file as dwg,dxf,step,iges etc. Also, visit website called angelsix.com and download application called :SaveAsX. With this app you can save as jpg,tif,dxf,dwg and pdf.

Problem with the attached macro is, that everytime i want to generate a pdf, or whatever, i have to make an active choice, which really does not change anything from pressing "saves as". I want a macro, which i can press, and without me doing anything else, prints the pdf to the designated folder on our network. I know it's possible, cause i got as far as printing the pdf and placing it in the location wanted, just not with the correct name/number.

hi rasmus is there anyway you can send me the macro you created. i am in the exact situation as you but i don't have any experience with macros so i am not able to modify deepaks macro like you did. thanks

me and a couple of guys at our company are using your very helpful macro for creating PDF's, we are all using Solidworks 2017 and accessing the Macro off of a server, however recently when trying to export a PDF, i get a pdf with a filename that is exactly 5 characters shorter that the drawing name. if the name of the drawing is 5 characters long, the macro does nothing at all. However, my friends are all accessing the exact same copy of the macro, and have no problems.

'Description: Macro to save active drawing as PDF and DWG.'Precondition: Any active drawing to be saved.'Postcondition: Active drawing will be saved as PDF and DWG in the same location as drawing.

' Please back up your data before use and USE AT OWN RISK

' This macro is provided as is. No claims, support, refund, safety net, or' warranties are expressed or implied. By using this macro and/or its code in' any way whatsoever, the user and any entities which the user represents,' agree to hold the authors free of any and all liability. Free distribution' and use of this code in other free works is welcome. If any portion of' this code is used in other works, credit to the authors must be placed in' that work within a user viewable location (e.g., macro header). All other' forms of distribution (i.e., not free, fee for delivery, etc) are prohibited' without the expressed written consent by the authors. Use at your own risk!' ------------------------------------------------------------------------------' Written by: Deepak Gupta (http://gupta9665.wordpress.com/)' -------------------------------------------------------------------------------

Dim swApp As SldWorks.SldWorksDim swModel As SldWorks.ModelDoc2Dim swDraw As SldWorks.DrawingDocDim Filepath As StringDim FileName As StringDim boolstatus As BooleanDim longstatus As Long, longwarnings As LongSub main()

Set swApp = Application.SldWorksSet swModel = swApp.ActiveDoc

' Check to see if a drawing is loaded.

If (swModel Is Nothing) Or (swModel.GetType <> swDocDRAWING) Then

swApp.SendMsgToUser ("To be used for drawings only, Open a drawing first and then TRY!")

Dim swApp As SldWorks.SldWorksDim swModel As SldWorks.ModelDoc2Dim swDraw As SldWorks.DrawingDocDim Filepath As StringDim FileName As StringDim PDFpath As StringDim DWGpath As StringDim boolstatus As BooleanDim longstatus As Long, longwarnings As Long

' Check to see if a drawing is loaded.If (swModel Is Nothing) Or (swModel.GetType <> swDocDRAWING) ThenswApp.SendMsgToUser ("To be used for drawings only, Open a drawing first and then TRY!")' If no model currently loaded, then exitExit SubEnd If

Deepak, this is how I have it set up, however it doesn't seem to be working. I have two folder on my K drive. One called EXPORT PDM PDF FILE (for pdm's) and one called EXPORT PDM DXF FILE (for dwg's). Both folders are located on my K drive but different locations for different file types. When I run the macro it acts like its doing something but when I check those locations nothing is there. I am obviously doing something wrong.