Using INT and FRAC functions with Inches Units
I have long avoided the INT and FRAC functions because they do not seem to work properly outside of the metric system.
I have managed to get them to work in with Inch units by first converting them to the native Centimeters units, for operation by the function, and then back again to inches afterwards.
There is nothing in the manual about this problem.
For an example I defined a Parameter called TestValue with a value of 4.36, and the following equations work:
FRAC(TestValue/2.54)*2.54 yields .36, or the equivalent fraction
INT(TestValue/2.54)*2.54 yields 4
The conversion factor here is the 2.54 Centimeters per Inch. You could probably to the same thing with feet (30.48)
I only found one relevant post in the whole forum to this issue: http://www.alibre.com/forum/viewtopic.p ... hlight=int
Here is my formula for rounding the Parameter DrawerBoxHeight to the nearest fraction, where the fractional denominator is in a parameter called Drawer_BoxHeightRoundingDenominator:
INT(Drawer_BoxHeightMax/2.54)*2.54 + (INT(((FRAC(Drawer_BoxHeightMax/2.54)*2.54)*Drawer_BoxHeightRoundingDenominator)/2.54)*2.54)/Drawer_BoxHeightRoundingDenominator
Drawer_BoxHeightMax is the Maximum Height of the drawer box based on the Opening_Height, and the clearance values above and below.
I have long avoided the INT and FRAC functions because they do not seem to work properly outside of the metric system.
I have managed to get them to work in with Inch units by first converting them to the native Centimeters units, for operation by the function, and then back again to inches afterwards.
There is nothing in the manual about this problem.
For an example I defined a Parameter called TestValue with a value of 4.36, and the following equations work:
FRAC(TestValue/2.54)*2.54 yields .36, or the equivalent fraction
INT(TestValue/2.54)*2.54 yields 4
The conversion factor here is the 2.54 Centimeters per Inch. You could probably to the same thing with feet (30.48)
I only found one relevant post in the whole forum to this issue: http://www.alibre.com/forum/viewtopic.p ... hlight=int
Here is my formula for rounding the Parameter DrawerBoxHeight to the nearest fraction, where the fractional denominator is in a parameter called Drawer_BoxHeightRoundingDenominator:
INT(Drawer_BoxHeightMax/2.54)*2.54 + (INT(((FRAC(Drawer_BoxHeightMax/2.54)*2.54)*Drawer_BoxHeightRoundingDenominator)/2.54)*2.54)/Drawer_BoxHeightRoundingDenominator
Drawer_BoxHeightMax is the Maximum Height of the drawer box based on the Opening_Height, and the clearance values above and below.