Pages

Wednesday, March 20, 2013

Using Capture Current State with Autodesk Inventor iLogic

The photograph itself doesn't interest me. I want only to capture a minute part of reality.
Henri Cartier-Bresson

Recently, I was working on a part where I was controlling the number of features in a pattern using iLogic.  Inevitably, I had to figure out how to take an existing feature, and change some of it's values with iLogic. 

But I didn't remember a lot of the details, like parameter names, or even the exact context for the command. 

Take a look at this automotive rim (it's just a sample file I'm using).   I want to control how many lug holes the rim has. 

This is the rim I'll be working with
Even though I've given custom names to the pattern that controls the number of holes, as well as the parameters driving the pattern, I may not know the names off hand.

I could pull them from the browser in iLogic, but that could be very time consuming if there's a lot of parameters to sift through, and it can mean a lot of scrolling up and down until the parameter is found.

And this is only one parameter, what if there were more? 


The parameter found, after a lot of scrolling up and down, though.

Another way I found that can be extremely helpful is to locate the feature, which even though there's a lot of them here, is easier to locate than a single parameter.  Once the feature is selected, right click on it and choose "Capture Current State".

Notice that I renamed the feature too.  It makes the feature I'm looking for a little easier to find.


Capturing the current state of the feature
Once the state is captured, iLogic gives me information about the current suppression of the feature, as well as grabbing the parameters associated to the features.

The current state captured
 The bonus of this method, is that I can use these values as the basis for creating my rules.  I'll start by adding my If/Then/Elseif statements.

Now, I could turn off my pattern completely if I changed the "True" to "False", like the example below:
Feature.IsActive("Lug Pattern") = False



But in this case, I'm only changing the number of Lug Holes, so I'm going to remove the lines that don't pertain to the number of lugs.

The final rule is shown in the image below:


The finished rule.
Now the rule can be checked, and verified.

4 lugs, check!

5 lugs, check!

Now this rule can be expanded by getting other states, or by using any combination of iLogic techniques.

For more information on creating an iLogic rule.  Check out my post from the archives here.

For some great iLogic resources, check out these blogs by Curtis Waguespack, and Paul Munford!

No comments:

Post a Comment