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.
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
Solved! Go to Solution.
Solved by pasi.annila. Go to Solution.
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
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
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
@pasi.annila wrote:Hi,
here is my succestion - hope it helps.
Thanks for the straight forward answer. it works and be able to display in increments of .5mm
@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
Hi,
try change b=33.7, the result =33.5? strange for me
Ok, it not strange. it incremental round.
Can't find what you're looking for? Ask the community or share your knowledge.