3 Replies Latest reply on Mar 5, 2013 3:01 PM by Daen Hendrickson

    Equation for holes/or parts distibuted at specified distances

    Philip McCollum

      I,m only starting to use equations


      I,m looking to distrbute holes or parts at a specified distance with the quantity of each increasing or decreasing as the part is varied in size. I also want to incorporate a minimum and maximum edge disdantce. This might require the items to be either symmetrical across the centre or one on the centre to satisfy the edge distance.


      For example say a flat extrusion 100(distance 1) x20mm has a series of holes along it with the minimum edge distance 5mm and the max edge distance 10mm to the edge of the holes. The 2 end holes will always be the same distance from the ends but as distance 1 increases/decreases the number of items may change as may the the fact that there will either be a centrally or symetrically placed hole(s) dependant on the distance 1.



        • Re: Equation for holes/or parts distibuted at specified distances
          Jeremy Feist

          just thinking through the equations a bit - I think you need to lock down one more variable, probably the hole to hole spacing...


          you may also want to look at the fill pattern feature.

          • Re: Equation for holes/or parts distibuted at specified distances
            Daen Hendrickson



            Attached is a part file showing how I would go about something like this.


            The idea is to create a seed feature for what you want to repeat. You position this seed feature either in the middle or offset depending on if you need an even or odd quantity. You use equations to determine that. Then you pattern that feature in two directions - in this case opposite directions on the same axis.


            To determine how much length you have available to place features, start with the total length of your plate and subtract the areas not available. In this case it would be the Minimum edge offset (X2 to subtract each end) plus your feature width (or half of your feature width X2 to subtract each end). Your feature width is the hole diameter.


            To determine the quantity of features, divide your available length by the feature spacing and add 1 more. You can't have partial features, so use the int() function to return only the whole number portion.


            There is a need to determine whether you need and odd or even quantity of features. The MOD() function is great for this but with the SW2012 and later equation manager, getting non-listed VBA functions to work can be tricky. I couldn't get the equation manager to accept a MOD() function so I came up with an alternative. If someone out there can get the MOD() working it will be a cleaner approach.


            To determine odd vs. even we check if our quantity / 2 is a whole number. To do this we compare int(quantity/2) to (quantity/2). If (quantity/2) is not a whole number - odd - the int() function strips off the decimal and the two items being compared are not equal.


            Read down through the equations and see if it makes sense.




            Changing Qty of Features.JPG