21 Replies Latest reply on Feb 23, 2015 7:42 AM by Mike Helsinger

    Multiple tolerances on drawing template

    Rolando Garza

      I’d like to create one D-size sheet template drawing.

      Once I use the template, I would like to be able to switch –depending on material- between two sets of tolerance values in the tolerance block.


      How can this be done?

      Can these values be inherited from the part?


      From what I've read, I can create a custom property and fill the text from that property for each precision.

      I'd rather not do that because I do not want to allow any value to be placed.

      The values I have are specific to material; so, I am looking for more of a toggle option.


      Normally, I would just script a reaction that monitors a value change on the part's material; but, I'm new to Solid Works(~1 week now); so, I'm looking for a non-scripted solution.

        • Re: Multiple tolerances on drawing template
          Jamil Snead

          One thing that comes to mind is that you could have each tolerance value on a different layer, so then you would show the layer for the tolerance you want and hide the other layer. It is not much trouble to switch between them.


          Another option would be to have the tolerance information linked to a custom property in the model file, then it would be inherited form the part. However you still run into the challenge of easily setting this value in the part file according to material.

          • Re: Multiple tolerances on drawing template
            John Stoltzfus

            If you are creating a D size drawing for multiple part files then you could save different drawing formats/templates with the different tolerances.  It won't matter which drawing you start from as you can always right click the page and go to properties and load the sheet that pertains to the project your working on.


            My recommendation is to keep all that information within the part file, so nothing changes. Setting it up the way you want to do it will open the door for mistakes down the road, different material, different part number, different file, in my book

              • Re: Multiple tolerances on drawing template
                Rolando Garza

                I was thinking about doing this too.

                In your opinion, how is this better than just saving each block off in its own layer and just swapping layers?

                  • Re: Multiple tolerances on drawing template
                    John Stoltzfus

                    It really depends on the work flow within the company and if you have interchangeable components and also if the assembly is going to be used for another customer with minor changes.  I reserve the first 2 or 3 sheets for the main assemblies then I add the sub-assemblies and then the parts, some files I have well over 50 pages of individual manufactured items and some just a few.  That way I can have a standard assembly as my base and if we do custom then I will do a pack & go change the part info then use the SolidWorks Task Scheduler to change the custom property information and I have a complete new set of prints.


                    With the parts/components in an individual sheet I can easily add or modify the assembly, without having to re-arrange a D size drawing....


                    If you want to go the individual sheet method then use the custom property builder to store individual part info, including materials etc....


                    One guy to follow is John George here in the forum, he was a huge help for me and take a look at his posts etc.....

                • Re: Multiple tolerances on drawing template
                  Mike Helsinger

                  Some months ago I did some macro work that imports the material as defined in the Feature Manager into the part's Custom Properties.  From there the material in custom properties imports through a link to the drawing sheet format.  You may be able to use a similar strategy.  I'd be happy to work you through any part of the process if you are interested in this route.

                    • Re: Multiple tolerances on drawing template
                      Rolando Garza

                      I'm very interested, Mike.

                      How would you like to proceed?

                        • Re: Multiple tolerances on drawing template
                          Mike Helsinger

                          My apologies for the delay, I have been out of the office since Thursday.


                          The approach I have in my mind may be foreign if you are that new to the software, so I'll say first that there is a fair amount of setup work, but once complete the process will automate by the press of a button.  We would:

                          • Define a material call out in the Custom Properties of your part file template
                          • Run a macro that reads this material entry in Custom Properties and outputs your tolerance requirement in a new field of the Custom Properties
                          • Link your drawing template to display the chosen tolerance value


                          The macro I created from my company serves multiple purposes so I'll pare it down to something relevant for your situation.  Tell me some specifics about your tolerance requirements per material.  Also attach a sample part and matching drawing as you would currently produce in your reply.  From there I can guide you through.

                            • Re: Multiple tolerances on drawing template
                              Rolando Garza

                              Here are some simple sample files.

                              I placed each Tol. text in its own layer and toggle between them - for now.

                                • Re: Multiple tolerances on drawing template
                                  Mike Helsinger

                                  Thanks for the files, I see that you are using the Material in the Design Tree which is helpful.  I am not accustomed to working with layers.  I see your drawing file has layer options of Standard, None, 0, 2 and 3 place decimal tolerance, however I don't really see how they are being utilized yet.

                                  Give me the specifics of what material choices lead to what tolerance requirements?


                                  Also, it's my impression that all we are manipulating is the title block, is that correct?  I ask because you also have control options for significant figure display of default and individual dimensions.  Manipulating these options is a separate process.

                                    • Re: Multiple tolerances on drawing template
                                      Rolando Garza

                                      I have the layers in there for now because the user needs to do this manually. I want to do away with the layers solution.

                                      As for material, I will be using custom material. I did not include that because I do not want to cloudy the discussion with another level of complexity.


                                      So, lets say the part is made of steel. I would like the TOL to be.:

                                      TOL ON ANGLE ±.5°

                                      1PL± .06 2PL± .030

                                      3PL± .010


                                      If the part is made of Copper:

                                      TOL ON ANGLE ±.5°

                                      1PL± .12 2PL± .06


                                      And yes, all i'm interested in right now is the TOL.

                                        • Re: Multiple tolerances on drawing template
                                          Mike Helsinger

                                          Okay I think I have something for you.  I'm attaching 3 files, one SW part, one SW drawing and one SW macro.  Here is how the process will work.  Open the drawing and part file. Now in the Part file define the material, then run the macro.  As long as the material includes the text "Steel" or "Copper" your drawing should have the correct tolerance values in the title block.  You may need to perform a rebuild in your drawing for the change to take hold.  If you change the material you will need to run the macro again to reset your tolerance values.  Now instead of changing layers in the drawing you define the material and then press a button.


                                          You will likely want a more senior member of your department to get involved to get the macro and template files in order.  I can advise you some but chances are your boss is going to want to be involved or at least aware of this action.


                                          Experiment with some of your typical scenarios and if you need help getting the bugs out get back to me.  Notice that if you remove the material or choose one without the correct text your tolerance values will disappear from the title block.  Try it out and get back to me, I'm curious how it works for you.

                                            • Re: Multiple tolerances on drawing template
                                              Rolando Garza

                                              can't open your files.

                                              i'm on 2013.

                                                • Re: Multiple tolerances on drawing template
                                                  Mike Helsinger

                                                  Uh oh.  Well we can do it piece by piece then.  I'm attaching a text document that contains the code for the macro that you will need.  I imagine it will work in 2013, but unfortunately I cannot test that.


                                                  This step by step should get you there:

                                                  • Save the Macro
                                                    • In SW, select Tools -> Macro -> New
                                                    • Choose a name (same as my chosen text file name for example) and location for your new macro
                                                    • Open the text file I sent you and copy all text
                                                    • Paste over all text in the macro.  The text in your macro should match identically to the text I attached.
                                                    • Save changes
                                                    • You may want to add a button or a keyboard shortcut to make this new macro more accessible, or you can run it through the menu Tools -> Macro -> Run
                                                  • Define Custom Properties in a part file
                                                    • Start a new part file, and save it somewhere you can experiment.
                                                    • Define your material in the Feature Manager Design Tree as you Normally would.  This material should include the text "Steel" or "Copper" for the macro to function as we have specified
                                                    • Run the Macro
                                                    • Menu to File -> Properties.  You should be able to observe Material, TolA, TolB, and TolC fields have been defined in your Custom Properties.  Click OK.
                                                    • Save your part file.
                                                  • Link Drawing to your Part file's Custom Properties.
                                                    • Create a drawing and insert your new part
                                                    • Edit Sheet Format and highlight one of the text entries we are linking and delete it.
                                                    • In it's place select this button
                                                    • Navigate to your appropriate tolerance and repeat for the other two.


                                                  Hope that gets you somewhere, I'm out of time for the day.

                                    • Re: Multiple tolerances on drawing template
                                      Ethan Kay

                                      Personal Account,

                                      I also recommend keeping tolerance information in the part file custom properties.  The benefit to this is if you need to make a new drawing for some reason or if you want to make a variation you don't need to start with the original drawing and make a lot of modifications, you can start with a new drawing and it will auto import the part properties.



                                      What information are you bringing in from the material?  Just the name or properties from the material?  SolidWorks by default allows you to show the material name in a custom property using "SW-Material@PartName.SLDPRT" but although you can enter the description, source, and custom properties you can't use them for anything outside of the material manager. 


                                      If you have figured out a way to reference a custom material property other than it's name in the part properties that would be great to know and would be a perfect solution to "Personal Account"s problem and I'd be interested as well since we use the custom material properties to reference equivalent material standards but as of now they are pretty much useless.

                                        • Re: Multiple tolerances on drawing template
                                          Mike Helsinger

                                          Yes I believe my approach will be at least marginally useful to this situation.  See my reply I posted a few minutes ago for my abstract to this problem.  The Macro I wrote for my company's situation is highly specific but it's fundamentals could easily benefit others.  Here's some of my background:

                                          I'm a one man engineering department for a 2nd/3rd party manufacturer.  We do no original design, rather use solidworks to import customer's design or create the necessary files from customer drawings.  - So - The Custom Properties in my incoming part files could have any or no structure so I generated a macro that does the following in a part file:

                                          • Scan for and read custom property fields that matter to my final document
                                          • Delete all Custom Properties
                                          • Define necessary variables based on
                                            • entries as read from incoming file
                                            • part number and revision per a file naming convention I defined
                                            • Material, thickness & K factor (we deal in mostly sheet metal) as taken from the feature manager design tree
                                            • Additional input prompts from the user (myself)
                                          • Generate custom property fields to satisfy the links in my drawing template

                                          And with that my title block is essentially populated with a keystroke and a couple other inputs done when I run the macro.  I plan on modifying my process to this situation to have a macro read the material, evaluate it based on Personal Account's criteria, and generate the tolerance selection back to the Custom Properties.

                                          • Re: Multiple tolerances on drawing template
                                            Mike Helsinger


                                            I read your question again and I should clarify - I don't have a SolidWorks trick to use the Material in any other way than a stand alone call out.  What I created is a way to read the Material as a text string that can be used for comparison to a known criteria.

                                        • Re: Multiple tolerances on drawing template
                                          Roland Schwarz

                                          Set up your drawing template to read tolerance values that are residing in the part's properties.


                                          Lots of bad things can and do happen when tolerances are driven only from the drawing sheet.