I am attaching small addin (private, not ADSK) for rounding up coordinates in Robot
You can add it to add-ins menu:
- as dll (the fastest method of getting results from robot) basing on dll_1.zip from this thread starting from point 13
- as exe
or by running exe
It seems to work OK.
Okay, I will make it. Also I will try to make installer with selecting language.
Unfortunately I don't see any localization resources in project inside RoundUpDown_2lang.zip
I can make it myself but it's will be more simply with ready resource.
Try this one.
If still not correct please send me at least part of this model with these nodes.
Sorry Rafal, I found something else that is not consistant.
Roundup2.jpg: Y-coordinate at last point was rounded up but the other ordinates changed from 10.210000 to 10.22 while the tolerance is only 0.01?
http://www.screencast.com/t/2Fe2nxr1M5L
Please review, also may be it will be more useful if "Other objects" deal with rounding structural axis coordinates as well.
thank you very much for your help.
Y-coordinate at last point was rounded up but the other ordinates changed from 10.210000 to 10.22 while the tolerance is only 0.01?
INteresting.
Please send me such robot file.
Maybe this link can help figuring out the approximation error.
http://www.theregister.co.uk/2006/08/12/floating_point_approximation/
More less this wqas the problem
According to our processors 10.21*100000 = 1021000,00000001
Correction in attachment
Can you post the .exe file please ..;
Thanks a lot.
I am not familiar with Csharp express etc ..
It was wrong attachement.
Check again attachment in previous message.
You are fast 🙂 It took me one minute to replace attachment and in the mean time you downloaded it.
This add-in is awesome!
Saves a lot of time with sloppy users 😉
I wanted to round to 0,05m so I had to make some changes to your code (to ToDec function), if you don't mind.
Maybe you're interested:
private double ToDec(double numberToTruncate) { double roundingVal = 1; int numOfDecimals = 0; if (TolcomboBox.SelectedItem != null) { string text = TolcomboBox.SelectedItem.ToString(); if (text.Length > 1) numOfDecimals = text.Length - 2; roundingVal = Convert.ToDouble(text); } numberToTruncate = Math.Round(numberToTruncate, 9); double power = Math.Pow(10.0, (double)numOfDecimals); if (radioButton1.Checked) { return Math.Round(Math.Floor(numberToTruncate / roundingVal) * power, 0) * roundingVal / power; } else { return Math.Round(Math.Ceiling(numberToTruncate / roundingVal) * power, 0) * roundingVal / power; } }
Function now can be used to round to any decimal value, for example: 0,25 😉
Cheers!
Hi Mirko,
Do you have an exe file for your modified version of this code?
Would be greate to have it..
Thanks
Regards
Janis
Of course
Here, just change the extension to exe and add it to robot
Right click on the link and "save link as"
Can't find what you're looking for? Ask the community or share your knowledge.