14 Replies Latest reply on Mar 12, 2014 3:03 PM by Jim Sculley

# possible equation mistake or "bug"

I recently posted a question that no one was able to help me out on and I eventually figured out my self.......had to recall some old algebra skills...... anyhow all of the math seems to be working correctly except for a few instances.  this equation is being used to "drive" and automated part file. pretty much the same part just different sizes. this part is as shown below in figure A.  When the width dimension changes, which is only in 0.5" increments I wanted the vertical wires to update accordingly. and dimension "C" to never be greater than 1.5" and the distance between wires to always be 1.5". I was able to accomplish this by using the "roundup" function, however the round up function can not be used in solidworks equations, so I used a work around to get the end result.  these two equations were input into excel and tested with success.  but when I input the "work around" equation into solidworks, in two instances solidworks is not figuring the math correctly. those two instances are when the width is 26.5 and 43.  figure B is a screen shot of my equation table. I have attached the part file with the equation table filled out and I guess I am asking if someone else would be willing to look at this and see if I am correct and solidworks is not calculating the math correctly or have I "input" something incorrectly. I think the equation for "global variable Z" is not being calculated correctly in the two dimensions of 26.5 and 43 and that is where the problem lies.

FIGURE A

FIGURE B

• ###### Re: possible equation mistake or "bug"

Kenneth,

I skip the math and use construction lines set to Equal length in many cases. Look into Design Tables, you can use the power of Excel to drive your designs too. In the case shown above I might use two equal length construction lines to set your "C" dimension, then just draw 8 more to set the seperation between the 'fins'. Those will not require a dimension. I did make the assumption that the spacing is equal.

• ###### Re: possible equation mistake or "bug"

Bernie,

thank you for your response, but that is not really what I am trying to accomplish.  this part is going to be used as a "template" sort a speak in driveworksxpress, so all the end user will have do to is input the desired width of the part and all will adjust accordingly. if you can please open the part file and change the width in .5" increments you will see that all changes, with exception to the two diemsnions of 26.5 and 43. I should also state that these equations are also driving numbers within text of the drawing for this part.  if I was to try this the way you have discussed then the end user would still have to figure out some dimensions and amount of "fin" lines.

• ###### Re: possible equation mistake or "bug"

also the "C" dimension in this case will always be ture to never being <1.000 or >1.500

• ###### Re: possible equation mistake or "bug"

Kenneth

For what you want to accomplish I would indeed go with equations.

The only thing that I see happening when using 26.5 or 43 is that the value C becomes smaller then 1.

If this is the problem then it stand to reason that you'll adjust your equations so as to prevent that from happening.

In other words, at some point you're rounding of the numbers fails to produce the desired result which in turn leads in a C < 1

I'm purely metric so forgive me if I'm not versed enough in inches to see the 'fault' of hand.

• ###### Re: possible equation mistake or "bug"

Peter,

no worries, my personal opinion the USA should have switced to the metric system long long ago.....thats beside the point though.

yes and no to your answer....yes that when using 26.5 or 43 "C" is <1.00 and no to the rounding (......I think......).

global variable "Z" states that  if the result of "X" - "Y" > 0 is true, then "Z" would = "Y"+1 and if the result of "X" - "Y" >  0 is false then "Z" would = "X".  this equation works everytime on any 0.5" incremented number except for 26.5 and 43.

however if this same equaiton is used in excel, this equation is 100% correct.

so my question is why does this work fully in excel, but in solidworks this eqution works for all except 26.5 and 43 (it could be wrong on other numbers but I have only tested it up 48)

• ###### Re: possible equation mistake or "bug"

I am still on 2012 so I can't see it mess up. what are you getting at 26.5 or 43?

• ###### Re: possible equation mistake or "bug"

Jermey,

26.5 and 43 would be the D1@Sketch1 diemsnions.    when D1@Sketch1 is either 26.5 or 43  the equation for "Z" does not solve correctly.

• ###### Re: possible equation mistake or "bug"

SPR 687256 may be relevant.  The IF statement in a global variable does not work.  You have to use IIF instead.

Try something like this:

Jim S.

• ###### Re: possible equation mistake or "bug"

Jim,

thank you for your response, but I still do not think that is correct.  the correct answer would be "c" = 1.5  with 25 equal spaces and 26 wires.

Ive uploaded another part file with the iif statement, solidworks solves the iif statement correctly on every .5" increment except when the width of the part changes to 26.5 or 43.

if you have a moment please change the width back and forth and see what you think. again if this same equations is put into excel or I just tried this several times, worked out on paper it is correct every time.

also there is a pattern to the "c" dimension, if started with a  width of 16.5 and increased by .5" increments, the "c" dimensions pattern is 1" then 1.25" then 1.5"        i.e.    16.5width = "C" of 1.000, 17width = "C" of 1.250,   17.5width = "C" of 1.500,  18width = "C" of 1.000,  18.5width = "C" of 1.250, 19width = "C" of 1.500.......so on and so forth.

• ###### Re: possible equation mistake or "bug"

file for jim

• ###### Re: possible equation mistake or "bug"

The equations I posted ignore the bezel width of your model since you did not specify it and I cannot open your model (still using SW2013).  I was working from the inside dimension of the bezel for which it works out fine for values from 8 to 50 (and everywhere else I expect).  You can account for the bezel by setting 'L' in my equations above equal to D1@Sketch1 - 2 * bezel width.

Jim S.

• ###### Re: possible equation mistake or "bug"

I sometimes don't open the files when commenting, on opening I see that you're using a weldment. I assumed that it was a heatsink and not a sectioned view of mulitiple parts. I did see a demo of Driveworks at a SW User Group meeting a year ago and that looks like its the direction for you.

• ###### Re: possible equation mistake or "bug"

Bernie,

yes, I am currently in the process of creating driveworksxpress files for the company I work for. driveworksxpress is very very helpful, and this equation can be solved in driveworks with the actual ROUNDUP function. I am just curious as to why this is not being calculated correctly in solidworks... and forgive me but what is a "heatsink"? I have not heard that term before in solidworks.

• ###### Re: possible equation mistake or "bug"

Kenneth,

Heatsink is not a SW term but a device that transfers heat from one side of a device to the other. You might see them cast or molded into valve covers on cars or on older stereo equipment. Another place they are frequently used is on the CPU inside your computer. There are many more and that was the reason I referred to your 'wires' as fins.

On another note, we use the term rack unit to define the number of 1 3/4" spaces in a rack cabinet. I was wondering is you used a similar term or variable and that converted the number of 1/2" spaces you refer to as common. Using an integer like that might help solve the issue you are experiencing. Maybe not but do let us know either way.