One of the side projects I work on semi-regularly is designing furniture in Autodesk Inventor. Mostly, that means taking designs that I find on the web or in books, and increasing the detail to the point of having full piece and assembly drawings.
I quickly learned to create templates containing "board blanks". Templates that contained a board already created, with parameters named "Length", "Width", and "Thickness".
|The original template. Just a board with Named Parameters|
Instead of redrawing that geometry every time, I would start a template with the geometry already created, and I was off to the races!
But soon, I found that I was using a lot of tenon joints. So I went ahead and created a second template with a tenon joint in it.
|The tenon "enabled" template. With it's extra parameters|
And I was proud of my ingenuity.
But now the challenge I faced was caused by my poor memory. There were many times I grabbed one of the templates, then part way through realized I should have grabbed the other template!
So I simplified my templates to one template that contained all I needed.
I created a template where I could control the suppression of the tenon using an iLogic Multi-Value List. Now I had something I could toggle on and off at will. With the flip of a switch, a "standard" board, or a "tenon" board.
|The combined template. The Multi-Value List shown with it's two options|
And I was *very* proud of my ingenuity!
But now, to "add octane to the mix" as said by Paul Munford in his blog post on "The CAD Setter Out" .
Over time, here and there, I created a better interface.
Over the years, and releases of Inventor, utilizing spurts of motivation to overcome barren planes of procrastination, I added a dialog box. Now I had something that was easier to interact with then opening parameters
A few months later, I got around to setting the dialog box greet you on file creation, saving the trouble of activating manually.
After completing that task only a few weeks ago, I decided to share this template with the world, so to speak.
This is one of those blog posts that frankly, I procrastinated on a bit. Why? It's a lot to write up.
So to ease the task I'm breaking it up into parts. So, first, let's get something functional.
How to Suppress and Unsuppress the Tenon!
For starters, name your parameters. It makes them easier to work with when creating your code.
Note the bottommost parameter "Joint Type" this is a multi-list that sets what type of joint is used.
Also, note there are a "Shoulder_Length" and an "Overall_Length" parameter. This parameters are toggled depending on whether or not a tenon is placed on the part. Ultimately, this parameter can be exported to the parts list for a cut length.
|The Parameter list.|
Once those parameters are created. Create an iLogic rule and use the following code to drive the rule.
'If Parameter "Joint_Type" is "Tenon Joint", then unsuppress the feature named "Tenon"
If Joint_Type = "Tenon Joint" Then
Feature.IsActive("Tenon") = True
'Set Value of Length equal to Parameter "LengthOL" (for eventual parts list export)
Length = LengthOL
'If Parameter "Joint_Type" is "Regular Joint", then suppress Feature named "Tenon"
ElseIf Joint_Type = "Regular Joint" Then
Feature.IsActive("Tenon") = False
'Set Value of Length equal to Parameter "Shoulder_Length"(for eventual parts list export)
Length = Shoulder_Length
Check out the video below for the fulls steps.
This portion of the blog only gets to that "functional" part of the rule It works great, but it requires that the parameter screen be opened every time. It may not be elegant, but it is effective.
I ran it like this for quite sometime? Why? It worked, and I never got around to further tweaking.
It's that classic case where I fell victim to "good enough".
In the next post, we'll add a form and make this rule run more efficiently and more user friendly.