Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good day Autodesk Community.
I'm having a bit of a problem here regarding Inventor's iLogic and the Math.Round function.
I don't know if I'm just not seeing something or what but all I wish to do is round a number to the 1ste decimal and assign it to iProperties.
Now, it's been working well but now something is strange.
The cut size is 1682.650mm. When I use this code:
Math.Round(extents_width, 1)
- it makes the cut size: 1682.6mm, and not 1682.7mm.
Rounding the .650mm to 1 decimal should make it .7mm.
Why is mine making the number .6mm?
Attached is an image aswell. Using 2023 Inventor.
Here's my code:
extents_length = Math.Round(SheetMetal.FlatExtentsLength, 2) extents_width = Math.Round(SheetMetal.FlatExtentsWidth, 2) If extents_length >= extents_width Then iProperties.Value("Project", "Description") = Math.Round(extents_width, 1) & " X " & Thickness - 1.5 & "/" & Thickness & " THK PLT X " & Math.Round(extents_length, 1) & " LG" Else iProperties.Value("Project", "Description") = Math.Round(extents_length, 1) & " X " & Thickness - 1.5 & "/" & Thickness & " THK PLT X " & Math.Round(extents_width, 1) & " LG" End If
Solved! Go to Solution.