Round up numbers with SolidWorks equations

Learn how to create a custom round-up function in SolidWorks when the built-in options fall short.

SolidWorks Equation is a very convienient tool for automatically calculating dimensions, feature parameters during modeling.

Sometimes you need to round up or round down to an integer (i.e. determine the number of pattern features).

There are two functions included in SolidWorks: int() and round().

For int(), it rounds down the value to the closest integer.

For round(), it rounds the value either up or down to the closest integer.

The problem here is, there is no build-in round up function. so what if you need to round up a number?

Here is the way to achieve that:

  • use the if() function: = IIF ( ( “Round up value” – int ( “Round up value” ) ) > 0 , int ( “Round up value” ) + 1 , “Round up value” ):