Professional Documents
Culture Documents
Save SOLIDWORKS Drawing To PDF Macro To Automate The Process PDF
Save SOLIDWORKS Drawing To PDF Macro To Automate The Process PDF
com/3d/3d-printing-service/)
Website (https://www.javelin-tech.com/) Careers (https://www.javelin-tech.com/site/careers/)
Store (https://store.javelin-tech.com/) Contact Us (https://www.javelin-tech.com/3d/contact-us/)
(https://solution.javelin-tech.com/facebook) (https://solution.javelin-tech.com/twitter)
(https://solution.javelin-tech.com/linkedin) (https://solution.javelin-tech.com/youtube)
(https://solution.javelin-tech.com/instagram)
(https://www.javelin-tech.com/blog/)
SOLIDWORKS VBA
Macro Code to Save
Drawing as a PDF
Article by Samony Riyaz (https://www.javelin-
tech.com/blog/author/samony-riyaz/) updated September 4,
2019
Usually when we want to speed up process tasks in
SOLIDWORKS, we tend to search for Macros that can do the
task for us so we can decrease our process time. A lot of
these Macros are published online by various users, but be
mindful as the code published is SPECIFIC to their machine
and environment and might not be the same for you.
Sample Code:
Sub main()
'Save
status = swModel.Save3(swSaveAsOptions_e.swSaveAsOptions_Si
strFilename = swModel.GetPathName
strFilename = Left(strFilename, Len(strFilename) - 6) & "pd
Set swExportPDFData = swApp.GetExportFileData(1)
swModel.Extension.SaveAs strFilename, 0, 0, swExportPDFData
End If
End Sub
The above code was altered so that along with saving the Drawing le,
it also exports a PDF of that drawing using the system default settings.
Once you have saved the macro, a Visual Basic for Applications
Dialog box will open with the default code below:
Replace the default code with the “Sample Code” shown above and
Save.
Posts related to 'SOLIDWORKS VBA Macro Code to Save
Drawing as a PDF'
(https://www.javelin- (https://www.javelin-
tech.com/blog/2020/11/solidworks-2021- tech.com/blog/2020/11/solidw
adds-vda-balloons/) macro-to-toggle-auto-rotate-vi
to-sketch-plane-on-sketch-crea
sketch-edit/)
No matter the size of your business, we have the skills and experience to
propel your organization to new heights.
NOTE: By subscribing you are granting permission to receive news and promotion
emails from us, unsubscribe at any time. View our privacy policy (//www.javelin-
tech.com/3d/privacy-policy)