.AsDouble() Precision?

I’m trying to pull the split gap from our coupling family - in this case 1/16". When I do, Revit pulls the number in feet which is fine, except that instead of 0.00520833… it shows 0.00525. Which is some weird rounding, seems like it should be rounding to 0.00521. However, it is half of 0.063 which is a rounded version of 1/16" in decimal inches (0.0625).

Does this 1/2000" matter? Probably not. I suppose it could add up over time, but I’m not sure what you’d be doing in Revit that many times in a row.
But, apparently it was just enough that happened to notice it when verifying the points were landing where I wanted them to.

I’m very zoomed in here, the gap shown is 1/16" , but in theory those blue dots should be right where those lines cross:
image

So this is mostly a question out of curiosity, but, does anyone know if there’s a way to control the precision when retrieving a parameter value with .AsDouble()? I tried changing my Geometry scaling, and project units, but that didn’t do anything.

Is the “AsDouble()” being executed in Python or in Dynamo core?

Python

That method? If so can you post the .dyn and a project with a single family which returns the error? I’d like to narrow down if the issue is on the Python to Revit translation or inside the code.

That’s the method, yeah. I’ve been playing with it some more, and it does seem to be something specific to either that project or that family. Which, again, all my project units settings are the same. I wonder if it has something to do with the lookup table?

Give me a minute and I can purge out this project and upload it.

Okay, nevermind, it was in fact the lookup table.
image

2 Likes