Round To Next 5 division, sketch function

Round To Next 5 division, sketch function

Alexrose1942
Advocate Advocate
1,782 Views
18 Replies
Message 1 of 19

Round To Next 5 division, sketch function

Alexrose1942
Advocate
Advocate

although I read this few times, still doesn't get how to "ceil" to next decimal.  image.png

0 Likes
Accepted solutions (2)
1,783 Views
18 Replies
Replies (18)
Message 2 of 19

JDMather
Consultant
Consultant

Your thread title and then problem description confuses me.

Can you attach your*.ipt file here and include a bit more information on intent for (round to next 5 division)?

 

Are you expecting 135 as the equation result?

 

For example, if I follow your design intent -

 

you want 

 

130<x≤135 to round to 135.  That is, anything greater than 130 but less than or equal to 135 to round to 135, and so on by divisions of 5.

 


-----------------------------------------------------------------------------------------
Autodesk Inventor 2019 Certified Professional
Autodesk AutoCAD 2013 Certified Professional
Certified SolidWorks Professional


0 Likes
Message 3 of 19

johnsonshiue
Community Manager
Community Manager

Hi! Below is a link to the explanation of various functions in Inventor Parameters dialog. "Ceil" function rounds decimal points up to closest integer. For example, if a parameter value is 399.63475, ceil(399.63475) will be 400.

 

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2016...

 

Many thanks!

 



Johnson Shiue ([email protected])
Software Test Engineer
0 Likes
Message 4 of 19

Alexrose1942
Advocate
Advocate

yes, I'm expecting 135 as a result, exactly. 

0 Likes
Message 5 of 19

johnsonshiue
Community Manager
Community Manager

Hi! It looks like there might be a file specific behavior here. Could you post an example illustrating the behavior?

Many thanks!



Johnson Shiue ([email protected])
Software Test Engineer
0 Likes
Message 6 of 19

YannickEnrico
Advisor
Advisor
Accepted solution

Hello there. 

In order to get it to the closest 5, you'd have to divide by 5 and later multiply by 5. 

I.e.

ceil((400/5)/3)*5 

Should give 135

_______________________________________________________________________________________
Intel Core i9-14900KF
64 GB DDR5 6000 MHz
2TB WD_BLACK
RTX A4000
------------------------------
Inventor 2026 Professional
Message 7 of 19

Alexrose1942
Advocate
Advocate

Correct just need to add mm to the 5.

Thanks for all the answers. 

ceil((400/5)/3)*5mm

 

0 Likes
Message 8 of 19

Alexrose1942
Advocate
Advocate

Big Oops , I think its still not working as I was looking for, if I type "400" its ok. but if I choose an existing dimension, again not working.

see the attached part 2017-09-11_11-53-36.gif

0 Likes
Message 9 of 19

ThomasB44
Mentor
Mentor
Accepted solution

Hi,

It's just a small unity problem.

Try like this :

ceil(d0 / 3 mm / 5 nd) * 5 mm


Thomas
Mechanical Designer / Inventor Professional 2025
Inventor Professional EESignature

0 Likes
Message 10 of 19

Alexrose1942
Advocate
Advocate

can someone explain why all this units issues, I'm working on mm, the whole model parameters are mm. 

 

just wonder if this something can be avoided in next releases.(I'm on 2015) and I see "nd" becomes "ul" for inventor, what does "nd" stands for?

 

 

0 Likes
Message 11 of 19

YannickEnrico
Advisor
Advisor

As @ThomasB44 said it's about units.

I didn't pay attention to the units when I wrote the concept formula 🙂

_______________________________________________________________________________________
Intel Core i9-14900KF
64 GB DDR5 6000 MHz
2TB WD_BLACK
RTX A4000
------------------------------
Inventor 2026 Professional
0 Likes
Message 12 of 19

YannickEnrico
Advisor
Advisor

UL is unitless. Not sure about ND


MM/MM = UL

MM/UL = MM

you can't divide mm by deg, for instance, since they're different units. 

And a length dimension can never be deg or ul. An angle dimension can never be mm or ul. An amount in a pattern can never be mm or deg. 

So you're constantly using all three types. I believe it makes sense to keep the units separate for a lot of different reasons. 



You can always force a unit change though:

Isolate(d0, mm, ul) for instance. d0 is mm, but you convert it to ul for this equation. 

_______________________________________________________________________________________
Intel Core i9-14900KF
64 GB DDR5 6000 MHz
2TB WD_BLACK
RTX A4000
------------------------------
Inventor 2026 Professional
0 Likes
Message 13 of 19

ThomasB44
Mentor
Mentor

nd means "undefined" unity

ul means "without unity"

Well, it's quite the same.

 

But, by default, when you type a formula, let's say :

ceil(d0 / 3 mm / 5) * 5

Some unities are automaticly filled in with "nd" :

ceil(d0 / 3 mm / 5 nd) * 5 mm


Thomas
Mechanical Designer / Inventor Professional 2025
Inventor Professional EESignature

0 Likes
Message 14 of 19

SBix26
Consultant
Consultant

The ceil function (along with floor and round) requires a unitless input.  I think a reasonable case could be made to change those to any units.  Are there any ideas posted proposing that?

 

Other functions, such as asin, acos, atan also require unitless inputs, but those trig functions are specifically defined as ratios, which are by definition unitless.  I can't see any particular reason why ceil, floor and round need to be.

Sam B

Inventor Professional 2018.1.1
Vault Workgroup 2018.0
Windows 7 Enterprise 64-bit, SP1

0 Likes
Message 15 of 19

ThomasB44
Mentor
Mentor

Hi @SBix26

I've found @DRoam idea about this subject.

Please see here : https://forums.autodesk.com/t5/inventor-ideas/accept-any-unit-in-parameter-rounding-functions-round-...


Thomas
Mechanical Designer / Inventor Professional 2025
Inventor Professional EESignature

Message 16 of 19

SBix26
Consultant
Consultant

Thanks for doing the search!  I just voted for that one, and I encourage the rest of the Inventor world to do likewise!

Sam B

Inventor Professional 2018.1.2
Vault Workgroup 2018.0
Windows 7 Enterprise 64-bit, SP1

0 Likes
Message 17 of 19

Alexrose1942
Advocate
Advocate

@ThomasB44 @SBix26 I did the same. hope the whole world will vote, and internal peace will arrive. 

0 Likes
Message 18 of 19

DRoam
Mentor
Mentor

Thanks for the shout-out, @ThomasB44, and thanks to everyone else for the votes! That idea really needed some attention, and you certainly gave it some. Hope it pays off soon!

0 Likes
Message 19 of 19

ThomasB44
Mentor
Mentor

You're welcome @DRoam Smiley Very Happy

I hope your idea will growth Smiley Wink


Thomas
Mechanical Designer / Inventor Professional 2025
Inventor Professional EESignature

0 Likes