Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rounding Up parameters or Ceil Up to nearest highest number

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
eggpa
8169 Views, 9 Replies

Rounding Up parameters or Ceil Up to nearest highest number

Hello, 

I know this is just a simple method to our experts out there. But im having some little issues not to arrive the desired value. 

 

2017-11-29_11-41-40

 

I just want  b=34, 33 or 33.5 NOT b=30 or 40 like the ceil() and round()
then b+bAllowance
i hope to achieve a result of b=34.5 or 33.5

 

I hope somebody can help me on this simple parameter question. thanks in Advance.

Regards,

eLi

 

9 REPLIES 9
Message 2 of 10
dgreatice
in reply to: eggpa

Hi,

 

Because you use Round directly in parameter, it just rounded to nearest.

example in math:
Round(3.45) become = 3

Round(3.54) become = 4

 

ok now implement to inventor parameter: use this math in your parameter value:

 

Round(b*1ul/1mm)*1mm/1ul

 

If you use iLogic Code, you can round number to specific number of decimal place:

example:

b = 3.45

Round(b,1) become =3.4

b=3.54

Round(b,1) become 3.5

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
Message 3 of 10
pasi.annila
in reply to: eggpa

Hi,

here is my succestion - hope it helps.

 

_poista.PNG

Message 4 of 10
pasi.annila
in reply to: pasi.annila

Of course you can use ceil or floor with same system.

Message 5 of 10
SBix26
in reply to: eggpa

Just piling on, here-- your parameter definitions are shown in red, which indicates that the equations contain an error.  The error is in the units, because the floor, ceil, and round functions require unitless arguments.  The simplest method is to simply divide the argument by 1 mm, then multiply the result by 1mm.

 

@pasi.annila has shown you how to alter that situation to round to the nearest .5 mm, which can be extended to round to any number you like.

 

Hope this helps,

Sam B

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

Message 6 of 10
eggpa
in reply to: dgreatice

Round(b*1ul/1mm)*1mm/1ul

gives me redline.. but it works when i change to lowercase..

round(b*1ul/1mm)*1mm/1ul

 

I havent deal with iLogic yet hopefully soon and looking forward to it.. Kudo's for the quick and prompt reply on my post @dgreatice

Message 7 of 10
eggpa
in reply to: pasi.annila


@pasi.annila wrote:

Hi,

here is my succestion - hope it helps.

 

_poista.PNG


 

Thanks for the straight forward answer. it works and be able to display in increments of .5mm

Message 8 of 10
eggpa
in reply to: SBix26


@SBix26 wrote:

Just piling on, here-- your parameter definitions are shown in red, which indicates that the equations contain an error.  The error is in the units, because the floor, ceil, and round functions require unitless arguments.  The simplest method is to simply divide the argument by 1 mm, then multiply the result by 1mm.

 

@pasi.annila has shown you how to alter that situation to round to the nearest .5 mm, which can be extended to round to any number you like.

 


Thanks for the reply Sam, I'm still learning about this parametric function of inventor. Hope to get more proficient with this. 

 

eLi

Message 9 of 10
dgreatice
in reply to: eggpa

Hi,

 

try change b=33.7, the result =33.5? strange for me

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
Message 10 of 10
dgreatice
in reply to: dgreatice

Ok, it not strange. it incremental round.

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report