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?
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.
a work around may be to add the appropriate number of blanke sheets to the front of the SLDDRW so that your page numbers display correctly. of course you would then have to remember not to print those pages.
his "spec" has pages before the drawing. I don't think those pages are in the SLDDRW. if it is the other way arround, I am out of ideas at the moment.
If you were starting at 1 and using the pre-defined properies mentioned earlier, they would auto-update.
does the addition of blank pages work for you?
I responded to your question over in the following thread.
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!
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
John, I don't know what a .swp file is. It isn't recognised by my computer.
It is a Macro..
While you're in the drawing file, rename one of your tabs COVER then hit the green arrow on the Macro Tools Manager, search for the attached and hit Ok..
It doesn't work straight away, but I will study the macro. It seems that you have to tweak the macro to suit individual requirements in any case. I haven't made any macros yet for SolidWorks. I've only used it for about 6 months so don't know all the possibilities. It seems like macros will be the way to go for anything that isn't already built in. Thanks for the help.
Should be no need to tweek the macro - If you have multiple tabs in your drawings, name the first tab COVER, second Tab COVER-1 and then add additional sheets, then run the macro, add a few more then run the macro again and see the difference. Make sure that you type cover in all caps "COVER"
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)"
Ed, there have been other cases where I wanted to use the sheet name in the text, such as a suffix to the drawing number. That's what I do in AutoCAD but I couldn't see how to do it in SolidWorks. Thanks.
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
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
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
Retrieving data ...