Python number precision output rounded to 15 decimals instead of 3

Hello, from Get Project Locations node:

is possible that this script gives coordinates output with more precission of decimals for example 8 to 15 decimals in the output numbers? also possible to get a list of documents as input in a python node out of a package?

Thanks

Hi Ruben…which node name from Alban, do you want to modify ?

Get Project Locations node

anyway i think 8 decimals works…more decimals will just slow, actually so hard precion we dont have when we build

just to make sure I do not miss the real Revit number stored, whatever works but not like the actual code

ovvv i see :wink:

Hi,

Sorry I forgot to reply to your previous message. But as you can see there is only a rounding for the angle.
Any other rounding is done by Dynamo when creating the Dynamo points.

Feel free to edit the script of the custom node.

2 Likes

Keep in mind that the number of decimals is a made up and theoretical thing after a certain point in any application. Let’s say you were working in miles (limiting your project to 22 units from the origin before you reach the limit of Revit’s geometry engine). You’ll obviously want to go smaller than that, but how small is practical?

Well for reference:

0.000000000000001 miles is 0.001 times the width of a Glucose Molecule. This is molecular scale, so unless your detailing looks like this you may have gone too far.

0.00000000001 miles is 0.003 times the length of a Cell’s Nucleus. If the building is going to have it’s accuracy verified using a microscope to confirm the location of each cell’s nucleons at the building scale, than you’d need this.

0.0000001 miles is 1.6 times the width of a Strand of Hair. Now hair has different sizes so this is a bit more out there as a unit of measure, but that is at least something you visually observe without a magnifying glass. That doesn’t mean the contractors can build to that tolerance, but you likely want to stop here as a means of accuracy review. If the building is off by a hair width and a half than I guess there could be problems with some edge case, but generally you need to account for this much movement of material via thermal expansion anyway - have them measure again on a cold or hot day if it is an issue.

At 0.000001 miles is 0.95 times the width of a Strand of Spaghetti. This is about 6/100ths of an inch or 1.6mm. You don’t want to go much bigger, though you may want to go a order of magnitude smaller.

Obviously if you are in different units (say meters, or light years) your ‘stop point’ will vary further. But at some point you will want to stop chasing precision as you very quickly hit the limit of our ability to accurately model the physical world.

4 Likes

Also keep in mind that while Revit’s accuracy may be (mathematically) to 15 decimal places, the working range is only to about 1/256" (~0.004). So while you may be able to work out the math to that accuracy, you will never have a model anywhere close to that.

I want to see at least 6 or 8 decimals in the output numbers, because the result is not right in some cases I had, in Revit shows instead of 0mm, it shows -0.00000008347 mm, therefore shared coordinate system would not match with other files and I can see that graphically with coordinate annotation tag in Revit and in properties tab of Revit

This is actually due to the very issue you’re suggesting (working outside the reasonable bounds of accuracy). Dynamo will return whatever level of accuracy exists in the model. The problem is that Dynamo has a higher precision than Revit. So sometimes when converting values from Revit to Dynamo (especially those affected by coordinates), Dynamo will include additional precision that does not exist in the Revit model and potentially return false values. The way to get around this is to round your Dynamo values to a reasonable level of accuracy (I usually go 5 or 6 decimal places).

2 Likes

The thing is that the accuracy is shown in Revit but not in Dynamo custom node of Geniusloci, then I am expecting to get same number of decimals numbers than Revit does graphycally in the properties tab or tags with 12 decimals as maximum possible in Revit.

I mean Dynamo interpretated all is fine but it is not, because I believed in a package node that shows only 3 decimals in coordinate points.

Ah I see. Interesting. I’m not familiar enough with the node to know where your rounding is occurring but I’d first make sure that all values are doubles. You might even try specifying any constants at the higher precision you’re looking for.

It still seems like the difference wouldn’t matter as the model can’t handle that level of precision.

Think closely about what these types of dimensions actually are in reality…

8*10^-11 power starts to be visible around the 7 minute 36 second mark of this video. https://www.youtube.com/watch?v=0fKBhvDjuy0

Are your projects being built so accurate that you are specifying things “in quantum motion, as a sphere of shimmering points”? Why would you even have it set at that value in Revit?

2 Likes

If you are having problems with two values that are essentially the same not matching, just round both to the 5th or 6th decimal place as @Nick_Boyts suggested, then you can try matching them up.

1 Like

but the stupid Revit modifies the decimals of numbers for unknown reason when it was expecting a full real number, zero decimals and we are talking about project coordinates, anything else it does not matter much but this issue is king

Out of curiosity, can you show an screen capture of your Revit coordinates to that level of precision?

This still makes me think that Revit might record the coordinates at that location but doesn’t actually have them placed at that level of precision.

1 Like

it looks like this code is rounding to 6 decimals in a few places:

Yes, but only for the angle of the base point.
To Convert XYZ API Points to Dynamo Points, the method .ToPoint() is used.

then I am thinking to extract the double X, Y and Z separately and convert those numbers to string because creating point or using math operations, Dynamo rounds the values