9 Replies Latest reply on May 22, 2018 3:43 PM by Kevin Andrews

    Set dimension style settings by sheet vs document?

    Kevin Andrews

      We do all of our prints on A size sheets (which I despise). This means that I, sometimes, have to get creative with dimensioning - even setting the text font down to 6 point with associative sizing on the arrows and such.

       

      This usually works pretty well - with the exception of when I have more than one sheet and the sequential pages aren't as crowded and I can relax the dimension font for easier reading. For instance:

      I just finished a cylinder head drawing that had a top, front, back, left, right, isometric, section a-a and section b-b..plus the title block and revision block. This was a ton of information to cram into one A-size sheet. Needless to say, this used 6 point font for everything.

       

      Notice that I did not have a bottom view on the page above? That's because I placed the bottom on its own sheet because it had dimensions for the bolt pattern. This was the only drawing on this sheet and it looked ridiculous with 6 point font - so I changed it all over to 8 point font. That may not sound like much, but it was a huge difference.

       

      Now, when we set the dimension settings, we do it through: OPTIONS - DOCUMENTS PROPERTIES - DIMENSIONS/ANNOTATIONS/VIEWS (SECTIONS), ETC. (I threw in the other settings that generally get changed to accommodate as well). So, my question: Is there a way to set these settings per sheet vs by document?

       

      It would be nice to see more options out beside "Document Properties" in the OPTIONS menu...document properties could be used to set the standard for the document, but as each sheet is added to the drawing, another tab would show up in options that would allow you to overwrite the document properties.

       

      If there is not a way to set properties per sheet, how do I properly enter a request for this? (8 year user and never entered a request).

        • Re: Set dimension style settings by sheet vs document?
          Matt Peneguy

          Kevin,

          I don't know how to do what you want without a macro.  All View Labels, etc. are treated the same on a per document basis.

          The good news is that I kludged together something that does just what you want.  (I'm sorry I didn't document where I borrowed the code, or I'd give credit.)  I give no guarantees on this.  So make sure you try it on non-production work, until you are comfortable with it.

              Const A_CHAR As Integer = 65
              Const Z_CHAR As Integer = 90
               
              Dim swApp As SldWorks.SldWorks
              Dim swDraw As SldWorks.DrawingDoc
              Dim swSheet As SldWorks.Sheet
              Dim swAnn As SldWorks.Annotation
              Dim swAnnObj As Object
              Dim curChar As Integer
              Dim curChar2 As Integer
              Dim curChar3 As Integer
          '
              Sub main()
                  
                  Set swApp = Application.SldWorks
               
                  Set swDraw = swApp.ActiveDoc
                  
                  If swDraw Is Nothing Then
                      MsgBox "Please open drawing document"
                      End
                  End If
                      
                  Dim vSheetNames As Variant
                  vSheetNames = swDraw.GetSheetNames
                  
                  Dim sheetInd As Integer
                  curChar = A_CHAR
                  curChar2 = A_CHAR
                  curChar3 = A_CHAR
                  For sheetInd = 0 To UBound(vSheetNames)
                      
                      
                      swDraw.ActivateSheet vSheetNames(sheetInd)
                      Set swSheet = swDraw.Sheet(vSheetNames(sheetInd))
               
                      Dim vViews As Variant
                      vViews = swSheet.GetViews
                      
                      Dim i As Integer
                  
                      For i = 0 To UBound(vViews)
                          
                          Dim swView As SldWorks.View
                          
                          Set swView = vViews(i)
                          
                          Select Case swView.Type
                              Case swDrawingViewTypes_e.swDrawingSectionView
                                  Dim swSectionView As SldWorks.DrSection
                                  Set swSectionView = swView.GetSection
                                  Set swAnnObj = swSectionView.IGetTextFormat
                                         
                                  Debug.Print swSectionView.GetLabel
                                  swSectionView.Get
                                  For i = 0 To swAnn.GetTextFormatCount - 1
                                  Set swTextFormat = swAnn.GetTextFormat(i)
                                      'Change text to be 10mm, bold, italic, and Comic Sans MS font
                                      swTextFormat.CharHeight = 0.01
                                      swTextFormat.Bold = True
                                      swTextFormat.Italic = True
                                      swTextFormat.TypeFaceName = "Comic Sans MS"
                                      bRet = swAnn.SetTextFormat(i, False, swTextFormat)
                                  Next
                                  
                              Case swDrawingViewTypes_e.swDrawingDetailView
                                  Dim swDetailedView As SldWorks.DetailCircle
                                  Set swDetailedView = swView.GetDetail
                                  Debug.Print swDetailedView.GetLabel
                                  swDetailedView.SetLabel GetNextName
                          End Select
                          
                      Next
                  
                  Next
                  
                  swDraw.ForceRebuild
                  
              End Sub
               
          Function GetNextName() As String
              For i = 0 To swAnn.GetTextFormatCount - 1
                  Set swTextFormat = swAnn.GetTextFormat(i)
                  'Change text to be 10mm, bold, italic, and Comic Sans MS font
                  swTextFormat.CharHeight = 0.01
                  swTextFormat.Bold = True
                  swTextFormat.Italic = True
                  swTextFormat.TypeFaceName = "Comic Sans MS"
                  bRet = swAnn.SetTextFormat(i, False, swTextFormat)
              Next
          End Function
          
          

           

           

          Scroll down and make the changes to swTextFormat.* to match what you need.

          Also, this works on all the sheets in the open document.  Just delete the outside loop.

          • Re: Set dimension style settings by sheet vs document?
            Kevin Chandler

            Hello,

             

            Telling SW about adding something you'd find beneficial is called an "Enhancement Request" or an "ER".

            Go to this post: SolidWorks Enhancement Requests

            Watch Mr. Banta's video that he linked in his original post and follow the steps outlined in the video.

            Do not post to this post as this will do nothing to get your ER in front of SW for consideration.

            Follow what's outlined in the video.

             

            Cheers,

             

            Kevin

             

            Forgive me for emphasizing the "do not" but others I've sent there posted nonetheless.

            Other than to bug Mr. Banta with a reply notice, your ER will get no further.

            • Re: Set dimension style settings by sheet vs document?
              Kevin Chandler

              Hello again,

               

              Can you make B drawings for A's instead and print the B to fit to letter?

              You can do this when printing to paper and also when printing to PDF (make a B PDF first, then print the B to an A PDF).

               

              Let the print code scrunch things.

               

              Cheers,

               

              Kevin

               

              Burn a reduced A size PDF for routing for example.

              EDIT: I attached some PDFs made as above:

              • Re: Set dimension style settings by sheet vs document?
                Josh Brady

                I'd have to echo Kevin's opinion here... Changing your fonts/arrows/etc on a sheet-by-sheet basis is not recommended practice.  Make a B size drawing, save as PDF, and print on A.  It will actually give you more clarity because the lineweights will scale as well (meaning that lines that are close together won't merge into one) and give you more room on the paper because the border/title block/etc will take up a smaller percentage.

                  • Re: Set dimension style settings by sheet vs document?
                    Matt Peneguy

                    Kevin and Josh have an easier and better solution than monkeying with the view labels and text.  But, if you use their advice, remember to remove the "SCALE X:X" from the view titles (this can be done in your template).  They will be incorrect, if you print at a different size than the sheet size.  Nobody in this day and age should be scaling dimensions...But, may as well remove the possibility.

                      • Re: Set dimension style settings by sheet vs document?
                        Kevin Chandler

                        Matt Peneguy wrote:

                         

                        Kevin and Josh have an easier and better solution than monkeying with the view labels and text. But, if you use their advice, remember to remove the "SCALE X:X" from the view titles (this can be done in your template). They will be incorrect, if you print at a different size than the sheet size. Nobody in this day and age should be scaling dimensions...But, may as well remove the possibility.

                        Matt Peneguy marks a great point about scale.

                        I suggest creating a drawing layer, make it red and add an NTS note of the required wording.

                        Turn the layer on (and make sure its print setting is also on) when you burn the NTS A PDF file.

                        Keep this layer off for the normal B drawing.

                        If you go this route, then add this layer to your drawing template so it's ready for future.

                         

                        Attached is the reduced A with such wording.

                         

                        Alternatively (or in addition to), create a layer for scale type notes and move these notes to this layer. Toggle off for reduced A drawings (& toggle on NTS layer).

                         

                        Cheers,

                         

                        Kevin

                    • Re: Set dimension style settings by sheet vs document?
                      Glenn Schroeder

                      Kevin Andrews wrote:

                       

                      We do all of our prints on A size sheets (which I despise). This means that I, sometimes, have to get creative with dimensioning - even setting the text font down to 6 point with associative sizing on the arrows and such.

                       

                      This usually works pretty well - with the exception of when I have more than one sheet and the sequential pages aren't as crowded and I can relax the dimension font for easier reading. For instance:

                      I just finished a cylinder head drawing that had a top, front, back, left, right, isometric, section a-a and section b-b..plus the title block and revision block. This was a ton of information to cram into one A-size sheet. Needless to say, this used 6 point font for everything.

                       

                      Notice that I did not have a bottom view on the page above? That's because I placed the bottom on its own sheet because it had dimensions for the bolt pattern. This was the only drawing on this sheet and it looked ridiculous with 6 point font - so I changed it all over to 8 point font. That may not sound like much, but it was a huge difference.

                       

                      Now, when we set the dimension settings, we do it through: OPTIONS - DOCUMENTS PROPERTIES - DIMENSIONS/ANNOTATIONS/VIEWS (SECTIONS), ETC. (I threw in the other settings that generally get changed to accommodate as well). So, my question: Is there a way to set these settings per sheet vs by document?

                       

                      It would be nice to see more options out beside "Document Properties" in the OPTIONS menu...document properties could be used to set the standard for the document, but as each sheet is added to the drawing, another tab would show up in options that would allow you to overwrite the document properties.

                       

                      If there is not a way to set properties per sheet, how do I properly enter a request for this? (8 year user and never entered a request).

                       

                      If you don't mind me asking, why stuff all those views on one sheet, instead of splitting it up into two or more?  That would seem to be much simpler than changing fonts.  And that's speaking from personal experience.  It's been years since I created a drawing using any size other than 8-1/2" x 11".  I rarely get by with just one sheet, and sometimes it's a dozen or more, although 4-5 is more common.

                      • Re: Set dimension style settings by sheet vs document?
                        Kevin Chandler

                        By the by, 6 points at 72.27 points/inch = 0.083 high text.

                        That's below code and it's a potential error source (and a continual pain the ass eyes).

                         

                        Follow Glenn's wisdom and spread your message across the number of sheets appropriate for the design and its message.

                         

                        Cheers,

                         

                        Kevin