This post is an adjunct the Shaker Table series, and describes how to grab a decimal number from an Inventor iLogic parameter, round that number to the nearest specified fraction, then pass that new number to a new parameter that will make its way to a Cutlist.
What is happening here is that the model is reporting a length from a driven dimension which can have quite a few numbers after the decimal point. The output we need is the closest fractional equivalent, so we will apply some math to round the driven dimension’s output to a fractional number. In this case, we will round to the nearest 32nd which would be a shop standard tolerance. The image below shows the driven dimension in question. It is attached to a line that describes the inner face of a corner bracket on a table design. The length of the line is entirely dependent on the overall size of the model as defined by the person fiddling with the inputs…

This information is contained within a Layout Part, and is passed to components created from the Layout Part, then fed to iProperties in those components, and are read at the drawing level by a Automatic Cutlist. The procedure is very simple, but I’ve had lots of people contact me with problems. The most common is using the Snippet > Math > Round Closest to Increment incorrectly. The raw snippet is as follows…

What people do is see the blue d0 in the equation, and believe that all they need to do is replace that with their parameter and the parameter will now be rounded to a fraction…

Which is wrong, and in this particular case, is wrong for a couple reasons. Firstly the formula is reading the parameter in that position, then doing the math, then outputting the answer to the variable at the beginning of the formula, roundedClosest. The other problem is that the Corner_Bracket_Length parameter is a reference parameter and cannot be modified by anything other than changes to the geometry the dimension is attached to.
In the model in question here, we will be returning the value of the rounded Corner_Bracket_Length parameter to a parameter, Fractional_Bracket_Length, instead of a variable…

The value of the Fractional_Bracket_Length is then used in the Cutlist…

That’s all there is to it. There are a bazillion more iterations that can be used to meet your particular needs –there is no such thing as one size fits all in parametric design, especially in Autodesk Inventor iLogic!
Subsribe to Post Notifications



Or you switch to metrical and just use the "round" function directly on your parameter…. more logic and less I-logic , I would say
I'm with you on that josteurs!
Hi Mark, Almost there but only the lengths of the end/side aprons to do. Are they calculated simply by the overall width/overall length minus 2"? Or do you creat parameters named End/Side_Apron_Length from driven dimensions (eg Tenon_Length and Apron_Length) inserted into the Sub Top Sketch and Tenon Profile Sketch and calculate their values by adding the driven dimensions and then multiplying by two.
Hi William,
Glad to hear you are getting close! Congratulations, you are mostly correct:
For both apron lengths, I added a driven dimension in the Tenon_Profile_Sketch ( the aprons should be projected into there). The dimensions go from the tip of the tenon to the end of the apron half. I called them Side_Apron_Half and End_Apron_Half, and their equation is simply multiplied by two as you had guessed.
When you need a driven dimension like this, its best to do the whole thing in one fell swoop. If what you need isn’t in any particular sketch, project it into the one that is closest, or create a new one and do it there. Wherever possible, project sketch geometry, not faces or edges of solids.
I will likely go back and split the top into separate boards –the number of which changes based on size, then output that to a glue-up schedule. Good luck finishing up!
Mark
Smileys and YouTube videos are now enabled in comments. Yea!