I have modified my drawing template and afterwards all my new drawings follow that now one but not the old ones and I need to change them manually one by one which is exhausting.
is there any way to let be automatic?
Changing the drawing template
Thanks Leon but the macro is causing SW to crush, I am running SW 2015, is there any other method then macro ?
I'm afraid not, but don't give up so easy on the macro!
Here, I've made it easier to use, try it out.
Thanks Leon for your efforts, it is saying that files updates but nothing happens ! please advise (I need to change the template layout and not the sheet paper size)
I have a blank drawing that I have in my templates/formats and I changed one page to the blank drawing and ran your macro and nothing happens, is this only for a single page document or multiple pages???..
Like your added note boxes though lol
Oh ok, my bad, I thought you needed to update the sheet's format.
HOW TO CHANGE/SWAP TEMPLATE/SYSTEM OPTIONS IN SOLIDWORKS | Boxer's CAD CAM Blog
did not work for me either.
I remember needing it a while ago, but I didn't bother to check what was causing problems and I just left my old drawing with outdated templates. The macro was making my Solidworks crash.
I'll take a look at it in the next few days to see if I can come up with a simpler solution.
ok thanks Leon, so we will be waiting for new news and it will be helpful for lot of people
It's always good to have a laugh from time to time while working .
Currently the macro will only update the sheet that was active when the drawing was saved, but it is an easy step to make it loop through all the sheets.
Are both of your drawing's sheets the same size/format?
The macro needs to be changed for Paper size based on template set. So may be select case needs to be added to fix the macro.
I doubt if original macro/excel sheet was ever updated. So instead of that I used another macro to update the document properties by using the saved out drawing standard file.
I don't need to change sheet format (paper size per ex), only the template sheet which contains text, company logo, ...
I have a bunch of drawings (not in the same folder though) with old template and I need to update them with the new template which has ".drwdot" format.
You need to change the sheet format layout? Like this texts/symbols/logos?:
You can not change drawing template but only sheet format. So save your sheet format and then change that paper size name and size in this line (in bold)
bRet = swDraw.SetupSheet4(swSheet.GetName, swDwgPaperAsize, swDwgTemplateCustom, 1, 1, False, sPath, 0.2794, 0.2159, "Default")
yep, exactly, now what I am doing is copy/past from my template all these lines & text. I need something automatic to update all drawings.
Oh, now we're talking, I'm working on it.
Now it should work, it will reload all pages in the same drawing and will let you set up multiple sheets sizes at a time:
Remember to always backup you data!!! I'm in no way responsible for any data loss!
Hi Leon, thanks but where I can file the file link ?
Actually the page was freezing that is why LOL
OR you could be trying to look for attachment in Inbox (they don't appear there).
ok now I try it after lot of tests and it works but with some problems. what I don't understand is why it keeps looking for "Change_Sheet_Format_v2.1.slddrt" file and I have already assign the template that contain all details.
You need to keep the file "Change_Sheet_Format_v2.1.slddrt" in the same folder as the macro, it is used by the macro.
That's because of an issue with SW. It won't update the sheet template unless you click the "Reload" button:
I can't reproduce the behavior of clicking "Reload" on the macro, there's no API call for that, that's why it is using the file "Change_Sheet_Format_v2.1.slddrt", it's a workaround.
The macro is first setting "Change_Sheet_Format_v2.1.slddrt" as the sheet template, and then, after that, it is setting the right template to your drawing. This workaround kind of mimics the behavior of clicking "Reload".
If you want, I can remove the need for the "Change_Sheet_Format_v2.1.slddrt" file, but then you would have to go back to each drawing sheet and click "Reaload", which would make the macro pointless in my opinion.
it is not here my problem, it is changing the new templates to that file and not the required template that I entered the path in the form. I don't see the need of the sheet format as long as the template contains all details including the sheet format. I wonder why SW doesn't solve this problem yet !
Also I used a custom size paper 11"x17", so the reload button is disabled
My guess is that you're using the ".drwdot" document as a template, that's why it is not working.
You should instead use a ".slddrt" file, which is a sheet template.
Can you send me a print-screen of the macro's form after you have set it up?
Retrieving data ...