The last post in this Inventor Tutorial left us with some brackets protruding into our fancy schmancy highfalutin new arches. We need to fix this artistic insult by finding the smaller of the two reference dimensions we placed in the last post in this blogtorial series, Inventor Tutorial – Shaker Table Arched Apron Option 2 –then, we’ll write some iLogic code to configure things (nearly) effortlessly.
On to the iLogic stuff….first off, we need to disassociate the brackets from the apron width. You may remember that way back when the Corner Brackets were added to the model that we used the Apron_Width parameter to determine the width of the bracket –which made sense as the two would always remain the same size. That is no longer so, so we need a new parameter to describe the bracket width.
Start the Parameter Editor (Model Tab > Parameter Panel), and add a new Numeric Parameter called Bracket_Width. In the Equation Column, click the little More arrow at the right hand side, click on List Parameters and choose Apron_Width from the list…



… which puts us right back where we started, but this is merely a placeholder dimension that will not allow damage to the model. When the iLogic code is written, we will replace this value dynamically. With that done, double click Corner Bracket A Ext in the Browser and change its distance to the new Bracket_Width parameter. Nothing will happen of course because currently Bracket_Width = Apron_Width.
There is one last place where we used the Apron_Width parameter, and need to replace it with the new Bracket_Width parameter. Double click on the Hanger Bolt Rigging sketch. There is just a construction line and a center point in the sketch, along with a dimension. Double click the dimension, click the More arrow, choose List Parameters, then choose the Bracket_Width parameter.
Now for the iLogic code that will automatically set our bracket width to the shorter of the two driven dimensions we created in the last installment of this Inventor Tutorial. The code is a very simple If Then Else statement that compares the values of the two dimensions, and makes the Bracket_Width parameter the same as the shorter of the two…
|
1 2 3 4 5 |
If Long_Apron >= Short_Apron Then Parameter("Bracket_Width") = Short_Apron Else Parameter("Bracket_Width") = Long_Apron End If |
Add the above code to the Arches iLogic Rule……….anywhere below what is already there will do. The brackets and the hanger bolt hole are now automatically configured. If you right click the Min/Max iLogic rule and choose Run Rule, all of the rules will run, and your bracket should look peachy…

Now to control the styling of the table, we will create a new tab on our configurator (iLogic Form) and add some controls for the arch. Right click the Shaker Table Form on the Forms Tab of the iLogic Browser, and choose Edit. When the iLogic Form Editor appears, the first thing to do would be to add a new tab. In the Toolbox on the lower right, click on the Tab Group feature and drag it up to the main form window on the upper right, and line it up with the main form label “Shaker Table”. When you see the little yellow arrow as shown below, drop the Tab Group…


Click on your new form group (may need to scroll down), and rename it Arch. If you look at your form, you now have a new, empty, arch tab…
Now we will add some controls. In the same manor the tab itself was created, we will now drag some parameters (upper left on the Parameter Tab) until the little yellow arrow points to the new Arch tab, and drop them there. All of the parameters are User Parameters, and they are Arch_Option, Apron_Width, and Arch_Reveal. Once all of them are there, you can sort them however you wish, but for the sake of this tutorial, put them in the order shown.
Configuring the parameters in the Properties window (lower right). To begin, click on the parameter you want to configure in the upper window, then, in the Properties window, adjust as follows (bold text denotes a changed property, these are the only ones you need to fool with);
Arch_Option

Apron_Width

Arch_Reveal

Now that the configurator is configurated, we need to edit the Min/Max iLogic rule to make an exception to the apron width portion of that rule when the arch option is turned on. You will note that in the arch reveal slider, we set the Maximum Value to 5.5 inches –we will create an exception that makes the maximum apron width 6” when the arch option is turned on.
Double click the Mon/Max rile in the iLogic browser, and insert the following iLogic code where shown in the image below…
|
1 2 3 4 |
'Arch override If Arch_Option = True And Apron_Width >= 6 Then Apron_Width = 6 End If |

With the iLogic code above in place, activate the form, and go to the Arch Tab. Set the Arch Option to False, and you will notice that the other two options will gray out. Switch to the Main Tab, and notice that the Apron_Width parameter there is not grayed out, and can be set to whatever you wish. Set it to 12” or so –anything above the 6” maximum for use with the arch option. Click Apply, then switch to the Arch Tab. Notice there is a 12 in the Apron Width box. Now set the Arch Option to True, and click Apply. The Arch option box now has 6” in it, and the apron resized.


Play around with the form a bit. Slick as snot, no?
Later.
Subsribe to Post Notifications



Hi Mark, Certainly is and in some configurations quite an elegant table. Couple of issues though. I think the iLogic code needs amending along the lines If Long_Apron = Short_Apron Then Parameter("Bracket_Width") = Apron_Width. Also, in some configurations I'm getting the error icons displayed in the browser for the Arch Sketches and Arch Cuts ("cannot solve equation") – I'll look into .
Hi Mark, I think I've figured out where the problem comes from. It's if you make the Arch_Reveal greater than the Apron_Width.
Hi Mark, Further to my first post. What I meant was that when no arched profile is present then the bracket width needs to equal the apron width.
Ahhhhhhh….. you are absolutely correct William. As-is, there is nothing in the iLogic code that will return the model to its non-arched state. Did you find out by running the configurations and getting a visual, or did the iLogic code seem wonky when you were writing it?
Here is the corrected code from the Arches iLogic Rule:
If Arch_Option = False Then
Feature.IsActive("Long Arch Cut") = False
Feature.IsActive("Short Arch Cut") = False
Bracket_Width = Apron_Width
Else
Feature.IsActive("Long Arch Cut") = True
Feature.IsActive("Short Arch Cut") = True
End If
The new line is line four where the bracket is returned to having the Apron_Width parameters equation. The code on the relevant page:
http://opendesignproject.org/2012/03/21/inventor-…
……has been updated. Thanks for the head’s up William!
Mark
Hi Mark, Visually saw it. I was trying to amend the code so that the bracket width was rounded down to the nearest 1/32 inch" when arches were present as we were getting a figure running to many decimal places. Which I think I've succeeded in by amending the Arches code to inc = .03125 Parameter("Bracket_Width") = Floor(Round(Short_Apron,4)/inc)*inc and likewise for the Long_Apron. With regards to the other issue when the Apron Reveal is greater than the Apron Width, bit more difficult for me to figure out. It would be useful if the maximum value of the slider property could be linked to the parameter Apron Width but the property value has to be a Double.
Hi William,
For the most part, you should never need to round for woodworking stuff like this. Any output to machine takes out the human factor, and can, and should, be left as-is. If you are outputting to a paper drawing, you just use fractional dimensions and set the Primary Units and Primary Tolerance to whatever your particular shop standard is, i.e., 1/16”, 1/32” etc.
I should probably do a post about that stuff this weekend before the new series begins…
Mark
Hi Mark,__I was wondering if it is possible to control a feature, such as the Apron Arch, from an Assembly. I have been trying but don't know how to link the feature.isactive command from the part to the assembly. I have been experimenting with multiple features on a leg part, then controlling them using a text parameter for Leg Type. I would like to control that from an assembly so that i could use a Table sStyle command to change which features are active. Any help would really help me along.__
James
Hi James,
Yes you can control a part from the Assembly. It sounds as though you may be thinking backwards though. you would not link "the feature.isactive command from the part to the assembly" but the other way around. Use the "IsActive(Ass'y)" snippet at the Assembly level to take control of the part.
Hope that helps. If you need any more help just follow up here.
Mark Randa
Thanks Mark, That worked a treat, i had tried that but i must have messed up the file somewhere, started again at it ran no problems. Thanks for all the tutorials, its amazing how little learning resources there are out their for iLogic. Just finished your iDrawer, would love to see some code for that but i suppose you have to keep some cards close to your chest. I'm messing with a Finger Joint that will update number of fingers depending on depth, going to approach it the same as your Board configuration rule. Any direction on this would be really appreciated.
Thanks Again for all your hard work, don't know how you do it.
James Corbett
Hi James,
Thanks for the complements! Without knowing all of the details of your finger joint project, I cannot be absolutely positive, but I would Imagine the board configuring code could easily be modified to do the trick. Just change the parameter names and thickness values. Give it a shot and let me know how it goes…
Mark