28 Replies Latest reply on Jan 5, 2018 3:39 AM by Marc Plensou

    Equal spacing equation

    Steve Crompton

      Hi

       

      Could help me with what should be a simple equation for an equation expert!!!

      In the attached there is a frame work. What I would like is to come up with an equation that would equally space out the inner tubes regardless of how many there are. So for example I would like 4 inner tubes with 5 equal gaps, if however I wanted to change it to 7 spaces the gaps would respace automatically.

       

      This attached is just an assembly for this exercise, however this is something that crops up quite a lot in my work and at the moment I'm getting out the calculator and doing the maths. I'm sure it would be much easier if I could do it with an equation.

       

      Any help would be greatly appreciated.

       

      Thanks

       

      Steve

        • Re: Equal spacing equation
          Martin MacDonald

          Hi Steve,

           

          I put together the equation then realised it was a 2015 file so couldn't send you back:

           

          "Inside Width" = Use the ref dimension you have

          "Width of Component" = Create a ref dimension of the width of the first member in the series

          "Number of Instances" = Driven by pattern instances

          "Free Space" = "Inside Width" - ("Number of Instances" * "Width of Component")

          "First Component Space" = "Free Space" / ("Number of Instances + 1)

          "Pattern Spacing" = "First Componenty Space" + "Width of Component"

           

          Then apply width mate to position first component and apply variable First Component SPace to drive this and Pattern spacing to drive component pattern spacing.

           

          Hope this makes sense. See below for an example.

           

            • Re: Equal spacing equation
              Steve Crompton

              Hi Martin

               

              Thanks for taking the time to do this. Feel free to post up the file. I did a file at home where I'm running 2016 and it opened here at work in 2015.

               

              Thanks again

               

              Steve

                • Re: Equal spacing equation
                  Steve Crompton

                  Hi

                   

                  I followed your instructions and it works great. I have asked solidworks through improvement requests if this solution could be turned into a mate of some description (still waiting ha ha). In a previous piece of software I used years back namely Turbocad you could do this with 3 clicks. You clicked both inside faces and then one of the internal components and everything spaced out equally.

                   

                  Maybe one day it could get incorporated in to the software, however until then I have this as a solution.

                   

                  Thanks

                   

                  Steve

                    • Re: Equal spacing equation
                      Martin MacDonald

                      That would be a great enhancement! I guess until that point it's down to good old calculations I have to admit I still like it when the calculation turns out correct. I dare say you could write a Macro that could do what you have mentioned. You could try asking in th API section see if anyone has any ideas?

                • Re: Equal spacing equation
                  Steve Calvert

                  There are others ways.

                   

                  1.  Pattern driven Pattern

                  2.  Sketch driven pattern

                   

                  Steve C

                    • Re: Equal spacing equation
                      Steve Crompton

                      Hi

                       

                      From one Steve C to another!!!

                       

                      Using my frame above could you possibly show me an example of how that would work.

                       

                      Thanks

                       

                      Steve

                        • Re: Equal spacing equation
                          Steve Calvert

                          So, without doing the actual modeling I'll give it a try.  I'm in between opening and working on some larger assemblies...

                           

                          1.  Pattern driven Pattern:  You make a pattern of a hole on the inside of the top and bottom rail (same part I'm thinking).  That pattern is equally spaced between the end of the rail.  You mate one vertical using the first hole as a mate aligmnent and then use the Pattern Driven Component.  It should see the pattern of holes you used in the rail and populate the assembly with that number of verticals.

                           

                          2.  Sketched driven Pattern:  About the same as above except you use a separate sketch with points

                           

                          Both of these are in the help.

                           

                          Steve C

                      • Re: Equal spacing equation
                        Arthur McRae

                        This Is what I did at a part level. I've done this at both a part level and a Assembly level.  O will reply in the newer post also.

                        • Re: Equal spacing equation
                          Alin Vargatu

                          Just curious: why don't you use the "up-to-reference" pattern? No need for equations in 2015 and 2016.

                          • Re: Equal spacing equation
                            Marc Plensou

                            This is very interesting. I have been looking for something like this.

                            I have a very similar challenge. My framework is like the above, but without mates and on part level.

                            What I want it to do, is to equally space out the balustrades to a maximum spacing of 89 mm, regardless of the overall length of the framework. So when changing the length from 1500 mm to 2300 mm, it would calculate the new number of balustrades with a new spacing up to maximum 89 mm.

                             

                            I would like to create a part, which I can run in DriveworksXpress to generate types with different lengths and heights.

                             

                            Anyone able to help?

                            • Re: Equal spacing equation
                              Joel Lesher

                              Good morning all. I am relatively new to the forums and just found this thread. I have benefited from the forums, so I thought I might try to contribute a little also. I do staircase and railing design and have ran into this issue. I have been doing my designs as assemblies and had decided not to mess with trying to build my formula into SW. My solution had been to create an Excel spreadsheet that ran the formulas for me. The downside is that if the design specs change then you need to remember to change the pattern spacing, but this has worked for me. My excel file is attached, hopefully someone else could also use it.

                                • Re: Equal spacing equation
                                  Marc Plensou

                                  Hello Joel

                                   

                                  Welcome aboard.

                                  I am new to the forum myself, in fact this is the first thread I have posted in.

                                   

                                  Do you use your Excel spreadsheet to do the calculations for you, so you can manually build your designs?

                                  I was looking for a way to automate my railings, posibly future stairs. Arthur was very helpful in this way, so now I have the equations to get solidworks to automatically calculate the number of balustrades and the spacing between them, up to maximum spacing.

                                  Your are welcome to download the files of course.