When using iLogic you want to make sure your sketch and model behave as you intended it to. You need to make sure the sketch doesn’t “break” by being fully constrained.
Just remember that, if you cannot make the changes in your model with the normal Inventor by flexing the model (changing parameters and seeing that the model stays intact), it will not work in iLogic.
To get started, let’s open the iLogic browser. You can find this under the manage ribbon in the iLogic panel.
The browser can either float on your screen or be docked. It is your personal choice.
When you are working out your iLogic code it is a good idea to write what you are trying to achieve out in full. This will help with what code to use and also trouble shooting if the code does not work.
I am going to make the table top work in the following way.
The 1400 mm and 1600 mm length should have a chamfer on the corners.
The 1800 mm and 2000 mm length should have a fillet on the corners.
So how do I achieve this? By using the “If…then…end if” statement.
By clicking on the If…Then…End If button, iLogic puts a statement down. We will be replacing “My_Expression” with our user parameters that we created.
This is what the code looks like:
The next command I will use is a snippet from the left hand side column. Snippets are very useful as by using this, we do not have to remember what to type in when trying to perform iLogic code. If you are doing something that is not in the standard snippets you can also save it as a custom snippet and share it between projects.
Using the ‘Features – IsActive’ command will suppress or unsuppress a feature.
If you right click on a feature you can Capture Current State.
Which gives you this. (This is a nice and quick way to get the state of features in a model.)
So the coding will look like the following, a combination of If…Then…End if, as well as a snippet for feature suppression. (I also edited the ‘Capture Current State’ by deleting ‘***Fillet1*** and d5 = 250 mm just to tidy up a bit.)
For the material we are going to use the material snippet from iProperties.
The code will look like the following:
So now we have 3 rules.
Opening the parameters dialog box and by only changing the Length, we get the following 3 scenarios.
Change Length to 1000 mm. Width automatically changes to 600 mm and both Fillet and Chamfer are suppressed. Material changes to Pine.
Change Length to 1400 mm. Width automatically changes to 1000 mm and only Fillet is suppressed. Material changes to Wood (Cherry).
Change Length to 1800 mm. Width automatically changes to 1400 mm and only Chamfer is suppressed. Material changes to Wood (Birch).
When working with iLogic, try not to have too many rules in a rule. As you can see, I have spread the length x width, material type and, if it has a chamfer, fillet or square corner over 3 rules. This also makes it easier when you are trying to trouble shoot.
So, by just changing 1 parameter we are able to change many different parameters as well. We are getting closer to our answer.
Next up: To iLogic or not to iLogic – Assembly configurations.
Aldred, the Mad Hatter