Attached is a macro to export all open drawings as PDF and DWG in the same location as the drawing file. The macro has been made on SW 2019 version but should work on earlier versions as well. Changing the macro reference to your installed as suggested here Fix-Update SOLIDWORKS Macro References? (don't worry on the fact that video is for fixing missing library error but check the process to update your macro library).
The macro would check for all open files and would process only drawing files. In case there is no file or no drawing file (will check only the drawings which has been saved), it would prompt the user.
If macro found a drawing then it would prompt user if he/she wants to export PDF & DWG both or only DWG.
If a drawing has not been saved ever, macro would skip that drawing and prompt the user. This would happen in case there is more than one open drawing and some of them have not been saved.
If there is no model view found in a drawing, macro would skip that drawing and prompt the user.
The exported PDF/DWG file name would be based on Part Number, Revision and Description custom properties values from the model. So make sure your model has these custom properties with values.
If you want to keep the same file name, then comment out the highlighted line and use the other line.
I'll be updating macro later to ask for a save location. Let me know what else you would like to get updated/added in the macro.
Macro: Export all open drawings as PDF and DWG
Macro: Export all open drawings as PDF and DWG
Deepak Gupta
SOLIDWORKS Consultant/Blogger
SOLIDWORKS Consultant/Blogger
- Ömür Tokman
- Posts: 359
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 993
- x 345
- Contact:
Re: Macro: Export all open drawings as PDF and DWG
Big Master, you are perfect.
Thanks a lot
Thanks a lot
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
Re: Macro: Export all open drawings as PDF and DWG
Great Job
Please look at the attached "Batch_Save_As_DWG_Seprate_Shts.text"
It is perhaps not the best written/pieced together Macro
But
it works for me...
But, particularly look at the bit that: ( that I think is a good idea )
Saves all sheets of all the Files in a specified directory as DWG files. with " - SHT 01", " - SHT 02" etc....
' NOTE: If there is only one sheet it will leave off the " - SHT 01"
This is to get rid of the 00... 01... 02... 03... prefix
SW would assign when saving a multi sheet SW drawing to DWG as separate sheets
and will put a suffix in stead of " ...- SHT 01", " ...- SHT 02" etc..
only if there is more than one sheet.
And it also saves all the DWGs in an "AutoCad Batch Saved" folder
The last bit in the macro is just to WAKE me up when it is done!
Please look at the attached "Batch_Save_As_DWG_Seprate_Shts.text"
It is perhaps not the best written/pieced together Macro
But
it works for me...
But, particularly look at the bit that: ( that I think is a good idea )
Saves all sheets of all the Files in a specified directory as DWG files. with " - SHT 01", " - SHT 02" etc....
' NOTE: If there is only one sheet it will leave off the " - SHT 01"
This is to get rid of the 00... 01... 02... 03... prefix
SW would assign when saving a multi sheet SW drawing to DWG as separate sheets
and will put a suffix in stead of " ...- SHT 01", " ...- SHT 02" etc..
only if there is more than one sheet.
And it also saves all the DWGs in an "AutoCad Batch Saved" folder
The last bit in the macro is just to WAKE me up when it is done!
- Attachments
-
- Batch_Save_As_DWG_Seprate_Shts.txt
- (9.09 KiB) Downloaded 607 times
-
- Posts: 1
- Joined: Thu May 18, 2023 11:34 pm
Re: Macro: Export all open drawings as PDF and DWG
The post you posted helped me a lot. Thank you.
However, I am inquiring because there is a part that cannot be modified.
I couldn't find the part number in the part where I found the part number, so I went to the description and got the conversion name. I don't know how to solve this.
However, I am inquiring because there is a part that cannot be modified.
I couldn't find the part number in the part where I found the part number, so I went to the description and got the conversion name. I don't know how to solve this.
Re: Macro: Export all open drawings as PDF and DWG
I'm not able to understand your issue. Can you share your file and some images explaining the issue in more detail.ghkdwkd007 wrote: ↑Thu May 18, 2023 11:40 pm The post you posted helped me a lot. Thank you.
However, I am inquiring because there is a part that cannot be modified.
I couldn't find the part number in the part where I found the part number, so I went to the description and got the conversion name. I don't know how to solve this.
Deepak Gupta
SOLIDWORKS Consultant/Blogger
SOLIDWORKS Consultant/Blogger