Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems with unit conversions in family formulas

2 REPLIES 2
Reply
Message 1 of 3
dbroad
279 Views, 2 Replies

Problems with unit conversions in family formulas

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.

Architect, Registered NC, VA, SC, & GA.
2 REPLIES 2
Message 2 of 3
HVAC-Novice
in reply to: dbroad

All good points. In general you want to avoid mixing metric and IP units. A lot of rounding going on that may add problems and may cost resources (not sure on that one). 

Revit version: R2025.3
Message 3 of 3
Mike.FORM
in reply to: dbroad

Although half a MM is not much of an error, if you are doing lots of calcs with formulas it can add up if units keep switching. 

If I am using some static lengths/sizes in a formula I will usually set the units of the family to the units I am using, in this case I would change to MM.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report