27 Replies Latest reply on Feb 21, 2017 4:33 PM by Elisabeth Daley

    Need help modifying a "sheet format update" macro

    Taylor Rucker

      I have hundreds of blueprints already created with multiple sheet formats throughout the bunch. All of the sheet formats were modified from one original that just happened to have a typo. Long story short I'm having to go through and modify the sheet formats. I found one of Deepak's macros that works pretty well for this. However I need to make a few changes and haven't had any luck doing it on my own yet. I need to be able to browse for the path name of where my sheet format is and browse for the sheet format .slddrt file. Currently both of these are static. I also need to be able to choose multiple folders when deciding what folder to update, rather than just one. I will include the macro as it currently sits, please feel free to ask questions about anything that I didn't make clear.

       

      Thanks,

       

      Taylor

        • Re: Need help modifying a "sheet format update" macro
          Leon Wurr

          Did you read this thread:?

          template update for drawings

           

          There's something similar to what you're asking there:

           

          pastedImage_0.png

            • Re: Need help modifying a "sheet format update" macro
              Taylor Rucker

              Thanks for answering so quickly Leon!

               

              I ended up using your version 2.0 instead of 2.1 as I do not need to change the sheet size. Is there anyway that it could be modified so that the folder we want updated will also include sub folders? The current macro will save me MANY hours, but if the macro could update all of the sub folder locations as well, that would be absolutely fantastic.

               

              Thank you for your help!

               

              Taylor

                • Re: Need help modifying a "sheet format update" macro
                  Leon Wurr

                      I'm working on it.

                   

                      Can you send me your sheet template so I can run some tests? (I'm worried that it won't work if you're not using standard A0,A1... sheet sizes)

                   

                      Feel free to remove sensible data from it as your company name/logo/etc..

                   

                      Also, it was not very clear if there's multiple sheet sizes or just different sheet templates but with the same size.

                    • Re: Need help modifying a "sheet format update" macro
                      Taylor Rucker

                      Attached is the updated sheet format that I need. There are multiple sheet formats, the only thing that changes between them is locations of blocks, specs, etc. All of the sheet sizes are the same.

                       

                      Thanks again!

                        • Re: Need help modifying a "sheet format update" macro
                          Taylor Rucker

                          I'm sure you are already aware, but when I run the macro with this sheet format, the resulting sheet is re-sized and too small. I am trying to figure it out now but if you could help me with that too I would greatly appreciate it!

                            • Re: Need help modifying a "sheet format update" macro
                              Leon Wurr

                                   I'll fix the sizing issue in the updated version, and I'll take a different approach so that you can use templates that are different, but with the same size.

                               

                                   One last question, do the updated templates have the same name and are located in the same place as the old ones (with the typo)?

                               

                                   Tomorrow morning I'll post the updated version of the macro.

                               

                               

                               

                                  

                                • Re: Need help modifying a "sheet format update" macro
                                  Taylor Rucker

                                  I have been editing the sheet format to fix the typo and then saving them in the same location as the old sheet format. I just figured out the sizing by using swDwgPapersUserDefined and 11x17. The problem I am running into now is that I don't want all sub folders to be updated. I know I'm being a pain in the butt. The way our file structure works, we have size A, B, and C, Each having requirements 1,2, and 3. Is there any way I could choose specific folders to apply the update to? I'll try to explain better,

                                   

                                  Part X

                                       Size A1

                                       Size A2

                                       Size A3

                                       Size B1

                                       Size B2

                                       Size B3

                                       Size C1

                                       etc.

                                  Part Y

                                       Size A1

                                       Size A2

                                       Size A3

                                       Size B1

                                       Size B2

                                       Size B3

                                       Size C1

                                       etc.

                                   

                                  I need to apply the update to Part X: A1, B1, and C1 all at the same time. Likewise for Part Y and so on.

                                   

                                  Thank you so much for your help.

                                    • Re: Need help modifying a "sheet format update" macro
                                      Leon Wurr

                                           Well, the macro was not supposed to be searching in sub-folders for files, that's odd, don't you mean that you don't want the other pages of the same drawing to be updated?

                                       

                                           Anyway, this should do the trick, change this lines on the macro:

                                       

                                                          bRet = swDraw.SetupSheet5(strNameSheets(j), intSize, swDwgTemplateCustom, varSheetProps(2), varSheetProps(3), varSheetProps(4), strSource, varSheetProps(5), varSheetProps(6), "Default", True)

                                                          If bRet = False Then

                                                              MsgBox "Something went wrong :(, check if the Change_Sheet_Format_v2.1.slddrt file is missing"

                                                              End

                                                          End If

                                                          bRet = swDraw.SetupSheet5(strNameSheets(j), intSize, swDwgTemplateCustom, varSheetProps(2), varSheetProps(3), varSheetProps(4), UserForm1.TextBox1.Value & swSheet.GetSheetFormatName & ".slddrt", varSheetProps(5), varSheetProps(6), "Default", True)

                                                          If bRet = False Then

                                                              MsgBox "Something went wrong :(, ending macro."

                                                              End

                                                          End If

                                                          swModel.ViewZoomtofit2

                                                      Next j

                                       

                                           The things in red are the ones that changed. This change assumes that the template you're trying to update has the same name and is located in the same path as the template already applied to the drawing, i.e, the sheet template did not change location or name, it has only been edited.

                                       

                                           This command "swSheet.GetSheetFormatName" will get you the name of the applied sheet template on the current page of the drawing. 

                        • Re: Need help modifying a "sheet format update" macro
                          John Stoltzfus

                          I finally found a macro that works, or rather I found out what I was doing wrong .....

                           

                          I use multiple sheets drawings, so I'll have up to 7 or 8 different sheet formats in the one drawing file.  The last few years there were multiple changes to the template and even name changes to the templates, this was a big issue here.  When you keep the same templates in the same template folder this macro works very well....

                           

                          Written by Deepak Gupta and edited by Garrett Hansen