Help with roundToNearest() math Function in parameter

Help with roundToNearest() math Function in parameter

Jallen_USBattery
Contributor Contributor
709 Views
3 Replies
Message 1 of 4

Help with roundToNearest() math Function in parameter

Jallen_USBattery
Contributor
Contributor

Hello,

 

I am designing an assembly that uses linear rails that are ordered in lengths incrementing by 25mm. 

I am trying to get Inventor to round a parameter to the nearest 25mm using the 'roundToNearest()' math function but everytime I try to use the function Inventor throws a fit and says it cannot parse equation... 

Note: I have also tried adding a "(equationhere) x 1mm", to see if it was because roundToNearest might be a UL function but that didn't help either...

 

Link to 'roundToNearest()' math function:

https://help.autodesk.com/view/ETOCOMP/2020/ENU/?guid=GUID-6DDEEF80-5964-406F-99A6-C982BB508607

 

Screen Shot is attached for what I am trying to do and the error I receive

Inventor RoundToNearest Error Screenshot 2023-05-03 215938.png

 

Can someone please set me straight on this?? 

 

Thanks in advance

0 Likes
Accepted solutions (2)
710 Views
3 Replies
Replies (3)
Message 2 of 4

pcrawley
Advisor
Advisor
Accepted solution

The help file you've linked to is for "Inventor ETO" 2020 - which had some iLogic-like programming capability, and "roundToNearest()" was one of those functions.  It's not a standard Inventor Professional function.

 

Try this for Inventor: 

params.jpg

To save you typing:

round(round(Length / 25 ul) * 25 ul)

roundedLength * 1 mm

 

Hopefully obvious - change the "25" in the equation if you want to change the increment.

Peter
Message 3 of 4

Alexander_Chernikov
Mentor
Mentor
Accepted solution

hi, try the following formula for parameter

round(round(Z_LinearRail_Length / 1 mm) / 25 ul) * 25 ul * 1 mm

 

Do you find the posts helpful? "LIKE" these posts! | Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням!
Have your question been answered successfully? Click "ACCEPT SOLUTION" button. | На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ"

Олександр Черніков / Alexander Chernikov

EESignature

Facebook | LinkedIn

.


Message 4 of 4

Jallen_USBattery
Contributor
Contributor

Thank you Alex & and PCCrawly, i eventually ended up doing exactly this. Just wish it was more clear that ETO wasn't native to Inventor. Now I know I guess.

Thanks for the help though!