Mathematical function in an equation of a room

Hello

 

I created in a part (SolidWorks 2014) an equation which is the sum of a series of dimensions of the 3D model to which I add 10% of the result.

In 99% of cases, the final result is a decimal point:

  • Is it possible, via a mathematical function (present in SolidWorks) to round up or down?
  • In the SolidWorks help, I couldn't find an array that gives the meaning of all the mathematical functions possible, did you find anything about it?

 

 


2015-04-01-equation.png

Hello

An interesting thread where they talk about it:

https://forum.solidworks.com/thread/27193

Excerpt from the best answer:

Also, SW has issues using an evaluation statement with = in it, so you will have to use LIKE instead. For example, if you wanted to make an equation that worked like this:

 

If "D1@Sketch1"=1 Then

     "D2@Sketch1"=2

Else

     "D2@Sketch1"=3

End If  

 

"D1@Sketch1" = IIF("D2@Sketch1"=1,2,3) This would not work

"D1@Sketch1" = IIF("D2@Sketch1" LIKE 1,2,3) But this would be

Yes, you have to put int(calculation to be done) in front of

 

example: Int(10/3) result 3

Sw will round down. To round up, add +1 to the end of the formula

 

So: Int(10/3)+1 result 4

7 Likes

Maybe also try the INT(x) function which returns the integer value:

http://help.solidworks.com/2011/French/SolidWorks/sldworks/LegacyHelp/Sldworks/Parts/Operators_and_Constants.htm

 

2 Likes