In this post we will add the rest of the current parameters to the iLogic’s Form Editor so that we may blast through the rest of the min/max iLogic code. I’ll make this one as short as possible as I think you may have it down-pat by now. If not, use the comment box at the end of the post to get clarification.
To begin this iLogic code writting session, we will go to the Forms Tab on the iLogic Browser, and right click on the Form 1 form we created in the last installment. Choose Edit, which will bring up the iLogic Form Editor. First thing to do here is drag all of the rest of the parameters over to the form. When that is done, grab a Tab Group tool from the Toolbox in the lower left, and place it at the top of the list of parameters you just dragged over. Now add another one somewhere in the middle of the pack. Now click on the Label 1 text and change it to Shaker Table. Now change the names of the tabs you just created to Main and Secondary. Now its just a matter of dragging the parameters and dropping them on top of whichever tab they will belong on…

When complete, you should have a two tabbed iLogic form that looks like the one to the right…
Now for the iLogic code for the min/max rules. I decided to put all of the min/max rules into one large rule. To do so, just rename the rule in the iLogic Browser. Now for some code writing. Double click the Min/Max rule in the iLogic Browser to bring up the iLogic Edit Rule dialog. When creating the minimum overall width (will apply to the minimum length as well) I found that I needed a new parameter that describes the minimum length of the aprons. So before going further, I closed out the iLogic Rule Editor, went back to the model and double clicked the Corner Bracket Sketch. I created a Driven Dimension called Bracket_Intrusion….
This driven dimension will feed real-time information to the formula we are about to create. I also created a normal parameter called Apron_Center_Min with an value of 3”. With the addition of these two parameters, we now have parameters that describe the entire width of the unit. When writing the iLogic code, I work my way from the outside of the table inwards selecting the parameters in the parameter to add to my formula. When I get to the Bracket_Intrusion, I need to click on the Reference Parameters if I wish to use the Parameters window for my selection…
The final code is as follows:
‘Min Leg Width
If Leg_Width < 1 Then
Leg_Width = 1
End If
‘Max Leg Width
If Leg_Width > 4 Then
Leg_Width = 4
End If
‘Min Overall Width
‘leaves a space between the brackets set by the Apron_Center_Min parameter
If Overall_Width < (Leg_Inset * 2) + (Leg_Width * 2)+ (Bracket_Intrusion* 2) + Apron_Center_Min Then
Overall_Width = (Leg_Inset * 2) + (Leg_Width* 2) + (Bracket_Intrusion* 2) + Apron_Center_Min
inc = .25 ‘ rounding increment ( .125, .25, .5, etc)
Overall_Width = (Round(Overall_Width ) / inc) * inc
End If
‘Max Overall Width
If Overall_Width > 47 Then
Overall_Width = 47
End If
‘Min Overall length
‘leaves a space between the brackets set by the Apron_Center_Min parameter
If Overall_Length = (Leg_Inset* 2) + (Leg_Width* 2) + (Bracket_Intrusion * 2) + Apron_Center_Min Then
Overall_Length = (Leg_Inset* 2) + (Leg_Width* 2) + (Bracket_Intrusion* 2) + Apron_Center_Min
inc = .25 ‘ rounding increment ( .125, .25, .5, etc)
Overall_Length = (Round(Overall_Length) / inc) * inc
End If
‘Max Overall Length
‘Based on maximum pure conjecture
If Overall_Length > 97 Then
Overall_Length = 97
End If
‘Min Overall Height
‘Cannot be less than 10 without a blow up
If Taper_Height + Taper_Reveal + Apron_Width + Top_Thickness < 10 Then
Overall_Height = 10
End If
‘Max Overall Height
‘Based on conjecture
If Overall_Height > 48 Then
Overall_Height = 48
End If
‘Min Apron Width
‘If apron width is set to be equal or greater than the formula below, then reset it to the same formula…
If Apron_Width < 2 Then
Apron_Width = 2
‘MessageBox.Show(“The Apron Width you have entered is less than the minimum width. It has been resized to the minimum width of 2 inches”, “Width too Narrow”)
End If
‘Max Apron Width
‘If apron width is set to be equal or greater than the formula below, then reset it to the same formula…
If Apron_Width > Overall_Height- (Top_Thickness + Taper_Reveal + Taper_Min_Height) Then
Apron_Width =Overall_Height - (Top_Thickness + Taper_Reveal + Taper_Min_Height)
‘MessageBox.Show(“The Apron Width you have entered has exceeded the maximum width. It has been resized to the current maximum of ” & Apron_Width & ” inches”, “Width too Wide”)
End If
‘Min Apron Thickness
‘If apron width is set to be equal or greater than the formula below, then reset it to the same formula…
If Apron_Thickness < Leg_Width / 4 Then
Apron_Thickness = Leg_Width / 2
‘MessageBox.Show(“The Apron Thickness you have entered is less than the minimum thickness. It has been resized to ” & Apron_Thickness & ” inches”, “Too Thin”)
End If
‘Max Apron Thickness
‘If apron width is set to be equal or greater than the formula below, then reset it to the same formula…
If Apron_Thickness > Leg_Width /4 * 3 Then
Apron_Thickness = Leg_Width / 4 * 3
‘MessageBox.Show(“The Apron Thickness you have entered is more than the maximum thickness. It has been resized to ” & Apron_Thickness & ” inches”, “Too Thick”)
End If

Now set your settings to those on the right, then save your model. Open the iLogic Code Editor and move the minimum overall height code block below the rest of the code. Close the editor and set the Overall_Height to 6” and click Apply.
As you can see, the fit hits the shan…
Hitting the back button will not fix things. Close the file without saving then open it back up to restore it. Now take a look at the code and see if you can tell why the ugly things happened.
We’ll leave the min/max iLogic code as it sits for now. You should have the gist of the min/max theory down by now. If not, just keep playing with it and ask questions in the comments below until you do. Do note that if you plan to go beyond what we have done here, do it in a separate file so that we are on the same page in future exercises.
More to come. See you then.
Subsribe to Post Notifications







How can I start from the beginning in order to have this beutiful table?
Thanks
Welcome to the ODP Luong,
Use the navigation links on the menu to the left to get to: >Inventor Tutorials > Designing a Shaker Table > Intro
I add tutorial posts to this menu regularly. Alternatively, you can use the Archives thingy to the right, or the Older posts (there is a Newer posts as well once you go back at least one page) link at the very bottom of the main page. If you have any problems, don’t hesitate to ask for help. Enjoy!
Mark
Thanks Mark
It is so nice that you put up all these lesson. My background in woodworking so long and been using some ProE and autocad, I wanted to learn inventor for along time but cannot do it till now I see all this. I spend last 24 hours to learn from this model and appreciate what you have done. Very sure that I will run into some problems and will need some of your expert helps.
Many thanks for this.
Hi Mark,
I am able to get up to ilogic part3.
I would like to ask for this ilogic Part 3, where do you use (Apron_Center_Min) in the Parameter list?
I went back last couple lessons to see but could not find it.. I might miss that.
Thanks
Luong
Hi Luong,
It is up above: “This driven dimension will feed real-time information to the formula we are about to create. I also created a normal parameter called Apron_Center_Min with an value of 3”.” The image directly above that was missing and is now in place.
I will often go back and show how to add to or modify existing models so be aware
Hi Mark, I have found two typos in your finalized code. Line 14 has an extra "A" in "Apron" and Line 29 has an extra "=" sign. Beyond that, I am getting the gist of it. I've played with some of the iLogic and found that it's not difficult, just extremely detail oriented. A missed character anywhere messes it up, as in any programming. I can see huge potential for Inventor and iLogic.
Hi Kent, thanks for the heads-up! The code that is actual text (as opposed to images of code) is edited in a html editor, I must be dragging duplicates when highlighting text to apply iLogic colors, or some such stupidity. Outside of the iLogic Editor, I don’t get the immediate feedback that something is amiss. But thanks to you I did get it, and It’s all fixed. Thanks again Kent.
As for the potential of ilogic, you are spot on. It ushers in a new age of design in my opinion –one that allows designers to automate their own design process in whatever way they see fit, not as some far-off programmer has decided for them.
Mark