[La...] Posted December 1, 2021 Share Posted December 1, 2021 Hello everyone. I'd like to make a comparsion of two elements using Result element. Lets say these two elements are two diameters, simply D1 & D2. For example D1=2mm D2=3.5mm Currently they have a +-0.005mm tolerance but it isnt need to be necessary. The most important thing is how much their actual size differs from each other. They can deviate from each other by 0.005mm even if they are out of their currently used tolerance. Example_1: D1 actual=1.998 D2 actual=3.504 D1 deviation is -0.002, D2 deviation is 0.004, its a 0.006 difference, so it isnt passed. Example_2: D1 actual=2.002 D2 actual=3.504 D1 deviation is 0.002, D2 deviation is 0.004, its a 0.002 difference compared to each other so its passed. I tried to make it work, but if the signs of the differences are not the same I don't get the correct value. (abs(getActual("D1").actual-getNominal("D1").nominal)) + (abs(getActual("D2").actual-getNominal("D2").nominal)) Is there a right solution to this problem? Thanks and BR, Link to comment Share on other sites More sharing options...
[No...] Posted December 1, 2021 Share Posted December 1, 2021 Wouldn't it be enough to just subtract the (absolute) actuals of both diameters from each other, minus the difference of the nominals (1.5)? Example 1: 3.504 - 1.998 -1.500 = 0.006 Example 2: 3.504 - 2.002 -1.500 = 0.002 So: abs(getActual("D1").actual - getActual("D2").actual) - abs(getNominal("D1").nominal - getNominal("D2").nominal) The second part (blue) is only there to calculate the difference of the nominal diameters. If this value doesn't change in a specific program, you can replace this with the concrete number (1.5) instead. Link to comment Share on other sites More sharing options...
[Zo...] Posted December 1, 2021 Share Posted December 1, 2021 if i understand correctky, you want do compare both deviation from nominals I use this code and it works: A = (getActual("D1").actual - getNominal("D1").nominal) _will show you deviation from nominal for "D1"_ B = (getActual("D2").actual - getNominal("D2").nominal) _will show you deviation from nominal for "D2"_ C = asb( A - B) you can combine these calculation in one line or put it in Presetting, and in formula just put "C" if A = +0.002 B = -0.002 C = 0.004 if A = -0.002 B = -0.002 C = 0.00 if A = -0.002 B = +0.002 C = 0.004 if A = +0.002 B = +0.002 C = 0.000 Link to comment Share on other sites More sharing options...
[La...] Posted December 2, 2021 Author Share Posted December 2, 2021 Thanks everyone, Both methods works well. Link to comment Share on other sites More sharing options...
[He...] Posted December 4, 2021 Share Posted December 4, 2021 getActual("D1").deviation - getActual("D2").deviation Link to comment Share on other sites More sharing options...
[Zo...] Posted December 8, 2021 Share Posted December 8, 2021 Please sign in to view this quote. this is so much better than my code 😃 didn't know you can use .deviation on features it shows you how many diffrent way there are, i used "caveman" method 🤣 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in