Problems with unit conversions in family formulas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I was trying to debug a cabinet formula that wasn't working this morning
The project units were fractional inches with a precision of 1/128". Some dimensions were in mm.
The original formula as keyed in
round(Holes/(ShelvesRows+1) * 32mm-8mm
which got converted to
round(Holes / (ShelvesRows + 1) * 1 67/256" - 81/256"
Holes and ShelveRows are integers. The result was supposed to be an accurate distance.
The resulting dimension was 0.5+- mm off.
The corrected formula:
(round(Holes / (ShelvesRows + 1)) * 32 - 8 ) * 1" / 25.4
This did the conversion without using the mm suffix but was dead on.
Using mm suffixes was convenient but imprecise. This post is a notice to help others and doesn't require a solution. In short, avoid using unit suffixes in formulas when accuracy is required.