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…
If Long_Apron >= Short_Apron Then
Parameter("Bracket_Width") = Short_Apron
Parameter("Bracket_Width") = Long_Apron
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);
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…
If Arch_Option = True And Apron_Width >= 6 Then
Apron_Width = 6
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?
Subsribe to Post Notifications