Inventor General

Distinguished Contributor
Posts: 140
Registered: ‎04-12-2005
Message 1 of 3 (232 Views)

Round fuction

232 Views, 2 Replies
11-14-2012 04:40 PM

I am using Inventor 2012.  I am trying to use the Round fuction in a parameter with no luck.


I have a the following parameters


wire_offset                in    wire_space+wire_wdt     0.231186


wire_offset_round     ul    round(wire_offset/1 in)    1.000


When I do wire_offset_round like this it works.  But if I want it to a 3 place decimal it does not work


wire_offset_round     ul    round((wire_offset/1 in), 3 ul)


According to the Inventor help, I should be able to do this.  But I can't.  I even tried it without the ul after the 3 and nothing.  Any clues?

Valued Mentor
Posts: 289
Registered: ‎05-23-2007
Message 2 of 3 (216 Views)

Re: Round fuction

11-14-2012 10:19 PM in reply to: cadcamm99



I am not sure which help you read, but, NO it will not work.


round (expr) will round to the closest whole number.


The syntax you have used WILL work with iLogic, and will change the rounding of an exported parameter, found in "iProperties, Custom"


What you can do for your current issue is change the precision of the value.


- Parameters

- RMB on "wire_offset"

- select "Custom property format"

- Change "precision" to 3


This will change the display of the value but not the value its self.


I will try and find the syntax to change the value, I have used it, but it does not always go in the direction you want it to. (Floor and ceil)



Autodesk Product Design Suite Premium 2014 SP1-Update 2 Build 222
Intel Core i7 (950@3.07GHz)/Win7x64 (Home) - 12GB Ram
Nvidia GeForce GTX 560 Ti
Please accept as a solution if it fixes your problem.
Posts: 1,847
Registered: ‎09-15-2003
Message 3 of 3 (194 Views)

Re: Round fuction

11-15-2012 04:52 AM in reply to: cadcamm99

In your example, I'm not clear how .231186 rounds to 1.000?  Doesn't work that way for me in 2013, anyway.  If, as I suspect, you want the number rounded to three decimal places, then the following should work:


wire_offset_round   ul   round(wire_offset * 1000 ul / 1 in) / 1000   .231000

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community

Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor