22 Replies Latest reply on Feb 4, 2016 7:02 AM by John Stoltzfus

    Drawing page numbers

    Alvin Hebert

      Does any body know what to link the page numbers to in a drawing template so that the pages automatically number themselves when i add new sheets or rearrange the sheets in a drawing?

        • Re: Drawing page numbers
          Jeremy Feist

          you need to link that portion of note text to 2 custom properties that solidwork automatically has in each drawing "sw-current sheet" and "sw-total sheets"


          more info on linking notes to properties is in the help.



          • Re: Drawing page numbers
            Anna Wood



            I responded to your question over in the following thread.







            • Re: Drawing page numbers
              Matt Harrison


              Ideally SolidWorks would have a feature to omit certain pages from the count, but it doesn't. I've got a similar problem with fabrication drawings. I want the cutting list to make up the first pages, then the drawing views to make up the others. My solution is this:

              Make a custom variable in the file properties called NoPages (or similar).

              Make a template with as many pages as are ever likely to be required & manually fill in the sheet numbers 1, 2, 3 etc. Time consuming, but only required once on the template.

              Make the total number of pages on each sheet refer to the custom variable previously created.

              When a drawing is complete, delete the un-used sheets & enter the correct number of pages in the custom variable that you created.

              That's the best I can come up with anyway!

                • Re: Drawing page numbers
                  John Stoltzfus



                  This has been an issue for me till.....


                  Leon Wurr wrote an awesome macro which reads the drawing Tab - see attached..


                  Here I have 5 pages, (You could have a lot more, no limit), that pertain to the entire project, Our ECR Information, Our ECN Information, Assembly BOM summary, Parts BOM summary, and Project Notes.. These could/can be anything you want.


                  These 5 pages are not listed in the drawing SHEET 1 of 40, if I have 45 drawings.


                  You can edit the macro to whatever Code Name you want, Leon made mine "COVER", so if you include the word COVER in the Tab. Here I have COVER-ECR, COVER-ECN etc...


                  Take a look and let me know if you have any issues

                • Re: Drawing page numbers
                  Ed Cyganik

                  You can manually rename your sheets;

                  ex: Sheet1 becomes BOR-1, Sheet2 becomes BOR-2 and so on.

                  ...then, Sheet3 becomes 1, Sheet4 becomes 2 and so on.


                  Now, use the following ling in your title block:

                     $PRP:"SW-Sheet Name(Sheet Name)"

                  • Re: Drawing page numbers
                    John Huntington

                    I have a macro that numbers the pages for me, so after I am done with my drawing I just run the macro and it numbers them


                    Option Explicit
                    Dim swApp As SldWorks.SldWorks
                    Dim swDraw As ModelDoc2
                    Dim SelMgr As SelectionMgr
                    Dim swSheet As SldWorks.Sheet
                    Dim vSheetNames As Variant
                    Dim i As Long
                    Sub sheetnumber()
                    Set swApp = Application.SldWorks
                    Set swDraw = swApp.ActiveDoc
                    Set SelMgr = swDraw.SelectionManager
                    vSheetNames = swDraw.GetSheetNames
                    For i = 0 To UBound(vSheetNames)
                    swDraw.Extension.SelectByID2 vSheetNames(i), "SHEET", 0, 0, 0, False, 0, Nothing, 0
                    Set swSheet = SelMgr.GetSelectedObject6(1, -1)
                    swSheet.SetName i + 1
                    Next i
                    End Sub