iLogic Tutorial for the iDoor Three – 10

iLogic Tutorial Three – Writing the iLogic Code

     The code for this feature is pretty simple. You modeled five edge profiles, and you created a Multi-Value iLogic Parameter that lists five options as well as a None option. You now need to link the Parameters to the features. Starting with the first line:

If Edge = “None” Then

What we are doing with this first line of code is telling the program that If the iLogic Parameter named Edge is equal to (the little multi-value button is set to) the value “None”, which was the first value we added when we created the multi value list, Then do whatever follows:

Feature.IsActive(“Edge_Profile_A”) = False
Feature.IsActive(“Edge_Profile_B”) = False
Feature.IsActive(“Edge_Profile_C”) = False
Feature.IsActive(“Edge_Profile_D”) = False
Feature.IsActive(“Edge_Profile_E”) = False

This code is telling the program that it is False that any of the edge profile features are active –which will leave all of them suppressed. It does not say what to do if the value is set to anything other than None, and would need to be told to end with the End If statement to be valid. We could do just that, and write separate rules for each profile, but it will be a lot easier to keep them all in one rule –so we will continue onto the next value with the ElseIf statement, and tell the program what to do if the Edge parameter value is set to Profile A:

ElseIf Edge = “Profile AThen
Feature.IsActive(“Edge_Profile_A“) = True
Feature.IsActive(“Edge_Profile_B“) = False
Feature.IsActive(“Edge_Profile_C“) = False
Feature.IsActive(“Edge_Profile_D“) = False
Feature.IsActive(“Edge_Profile_E“) = False

This code, as well as after it, would be ignored if the first argument were satisfied i.e. the value was set to None. If the program found the multi-value setting set to Profile A, then it would carry out the instructions above to suppress all but Edge_Profile_A. If the setting were at Edge_Profile_E, it would simply pass over all of the code until it found instructions for that value. If it finds none, it does nothing.

 

 

 

Rule E. The code below shows what separate rules would look like. You would need one for each value of the Edge parameter, or six of them. If this were the only one present, none of the values in the multi-value list would do anything until you got to the Profile E value, which would fire the code below and unsuppressed Edge_Profile_E. Once fired the first time, you would be stuck with Edge_Profile_E. Try it once.

If Edge = “Profile EThen
Feature.IsActive(“Edge_Profile_A“) = False
Feature.IsActive(“Edge_Profile_B“) = False
Feature.IsActive(“Edge_Profile_C“) = False
Feature.IsActive(“Edge_Profile_D“) = False
Feature.IsActive(“Edge_Profile_E“) = True
End If

The full code is here: Profile_Code.txt –if you are having any problems during testing, the first place to look is the spelling. “None” is not the same as “none“, all code is case sensitive. Missing underscores and spaces where they shouldn’t be is also common.

If this iLogic tutorial has helped you at all, please consider linking from your home page, blog, or in discussion groups to spread the word. Thanks!

 

- iLogic Tutorial Three Navigation -


Intro
12345678910

 






iLogic Tutorial for the iDoor Three – 09

iLogic Tutorial Three – Creating the iLogic Parameters

    Add the values shown in the image below left to the Add New Items box of the Value Editor List that will appear, then click the Add button to insert them into the Value field. Click OK to create the new Multi Value Parameter.

 

iLogic Tutorial for the iDoor-Three Page Nine Image 01 - Value Editor Add Field            iLogic Tutorial for the iDoor-Three Page Nine Image 02 - Value Editor Value Field

As soon as the Value Editor closes, the new Multi-Value list will be present in the iLogic Parameter Editor as is shown in the image below. We now need to connect these values to iLogic Rules that will control the behavior of the edge profiles we created earler. Click Done to close the Parameter Editor.

 

iLogic Tutorial for the iDoor-Three Page Nine Image 03 - iLogic Parameter Editor

iLogic Tutorial for the iDoor-Three Page Nine Image 04 - iLogic Rule Name

 

 

 

Now go to the iLogic panel and click on the Add Rule icon. The Rule Name entry box will pop up, where you will add Profile and click OK.

 

 

iLogic Tutorial for the iDoor-Three Page Nine Image 05 - image of the iLogic Code

 

 

 

The code for this rule is very simple, and can be seen in its entirety to the left and downloaded here:

 Profile_Code.txt

We’ll go over the first chunk of code below, the rest you just copy, paste, and tweek.

 

 

 

 

 

 

- iLogic Tutorial Three Navigation -


Intro
12345678910

 






iLogic Tutorial for the iDoor Three – 08

iLogic Tutorial Three – Creating More Cutter Profiles

iLogic Tutorial for the iDoor-Three Page Eight Image 01 - Inventor Sketch

 

Now you will need to draw a line a short distance starting at the junction between the top horizontal line and the uppermost arc shown as A in the image to the right. Make sure the vertical constraint glyph is visible before ending the line.

Now add a tangent constraint between the line just drawn and the arc it is attached to. Make the line construction geometry, and apply an Equal constraint between it and the lower horizontal line shown as B to the right. The equal constraint is merely to assure the sketch is fully constrained when complete. It should need six more dimensions at this point.

  

iLogic Tutorial for the iDoor-Three Page Eight Image 02 - Tangental Constraint

 

The image to the left shows all of the remaining dimensions, and there is a perpendicular constraint between the two lines pointed to by the arrows.

There is a 70° angle constraint between the bottom horizontal line and the first line moving upwards. The smaller radius to the right is .0625 and the larger radius is double that at .125. The top reveal dimension is .5. The sketch should now be dark blue and the status bar should report a fully constrained condition. Rename the sketch Edge Profile E and save.

 

  

Sweep the profile as before. You should wind up with a gaudy new profile like the one below…

 

iLogic Tutorial for the iDoor-Three Page Eight Image 03 - The Finished Profile

Rename the new profile Edge_Profile_E, supress it, and save the file. Now it is time to add an iLogic parameter called Edge.

 

 

 

 

 

Switch to the Manage tab, and open the iLogic Parameter Editor. Set the filter to All-Key, and type Edge into the Name column of the empty row at the bottom of the table. Under Type, choose string, then right click anywhere along the row to bring up the context menu where you will choose Make Multi-Value.

 

iLogic Tutorial for the iDoor-Three Page Eight Image 04 - iLogic Parameter Editor

 

- iLogic Tutorial Three Navigation -


Intro
12345678910

 






iLogic Tutorial for the iDoor Three – 07

iLogic Tutorial Three – Cutter Profile Creation

iLogic Tutorial for the iDoor-Three Page Seven Image 01 - Image of the Feature Browser

The next two profiles are created exactly the same as the last one with the only difference being the radii, the names of the sketches, and the names of the profiles.

The next sketch is Edge Profile C, the radius is .25, and the profile is called Edge_Profile_C.

The one after that is  Edge Profile D, the radius is .375, and the profile is called Edge_Profile_D.

All of the sketches are started on the Edge Profile plane, and all use the Edge Path as their path. Suppress both of the features when they are complete. For the naming, it is easiest to just copy and paste the previous name for the same feature, and change the suffix.

The last profile is the same in most ways, but is the most complicated of them all. Once you have the sketch to the point where you have the point projected, project the lower top corner as well as shown in the image below, then shut off the Edge Path sketch as per usual.

 

  

iLogic Tutorial for the iDoor-Three Page Seven Image 02 - Project Point

 

iLogic Tutorial for the iDoor-Three Page Seven Image 03 - Create an Arc with Line Tool

 

The next step is to get the sketch as shown in the image to the left. The horizontal line at the top needs to be drawn separately, but the rest can be drawn in one continuous chain of line segments.

If you have forgotten how to do the radii, when you get to the end of a straight segment and want to start an arc, press and hold down the left mouse button and drag the arc. look for the tangent constraint glyph as all line to arc connections shown have a tangent condition. Add the .01 dimension from the vertical line to the tangent of the arc at this point.

 

 

 

 

 

 

 

iLogic Tutorial for the iDoor-Three Page Seven Image 04 - Extrude Preview

 

 

 

Add a Coincident Constraint between the end of the open arc and the end of the top vertical line to close the loop. Test the loop by pressing the E key and passing your cursor over the profile. It should fill with a red preview.

 

 

 

 

- iLogic Tutorial Three Navigation -


Intro
12345678910

 






iLogic Tutorial for the iDoor Three – 06

iLogic Tutorial Three – Creating the configurable cutter profiles

    Rename the new sweep feature Edge_Profile_A. If everything looks good like in the image below, suppress the feature and we will begin the next one.

 

iLogic Tutorial for the iDoor-Three Page Six Image 01 - Compleated Sweep Feature

iLogic Tutorial for the iDoor-Three Page Six Image 02 - Begin Second Profile

 

 

We will be reusing the path and sketch plane for all of the sketches, so to begin the next sketch just grab the Create 2D Sketch
 tool and click on the Edge Profile Plane in the browser. Right click and slice the graphics. Make the Edge Path sketch visible and project the junction of the two lines again to create a point, then turn off the Edge Path sketch again.

Again create lines starting at the projected point and running horizontal and vertical, and this time a single three point roughly as shown. Grab the Tangent
constraint and constrain the arc to each of the lines.

 

 

 

iLogic Tutorial for the iDoor-Three Page Six Image 03 - Coincdent Constraint

Get the Coincedent Constraint
tool and constrain both end points of the arc to the end point of the closest line. The arc should now be at 90° as shown to the left, and require one dimension. Add a Dimension
of .125 to the arc, and the arc should turn dark blue, and the status bar should report the sketch as fully constrained. Finish the General Dimension
command by right clicking and choosing Done.

 

 

 

  

 

 

Right click in the geometry window and choose finish sketch. Make the Edge Path visible again. Create the sweep cut feature exactly the same as last time. Turn the Edge Path sketch back off,  rename the sweep to Edge_Profile_B, supress the feature, and save the model.

 

- iLogic Tutorial Three Navigation -


Intro
12345678910

 






iLogic Tutorial for the iDoor Three – 05

iLogic Tutorial Three – Yet more profile creation

The final two dimensions for this sketch are the radius of the lower ac, and the overall reveal as shown below. The radius is .25 and the reveal is .75. and the sketch should be fully constrained. Right click in the graphics window and choose Finish Sketch. Save the file.

 

iLogic Tutorial for the iDoor-Three Page Five Image 01 - The Finished Sketch

Now turn the visibility of the Edge Path sketch back on, and grab the Sweep
tool from the Create Panel
. More than likely, the program will try to select the larger profile of the Edge Path sketch, make sure you select the profile you just created. It should look like the image below…

 

iLogic Tutorial for the iDoor-Three Page Five Image 02 - Create the Sweep

…notice that the right stile solid body will be selected for participation in the procedure as can be seen by the dashed magenta lines. The Path selector should now be active, so select the Edge Path sketch. You should get a green preview of the profile following the path all the way around the part, and the right stile should be selected as the only solid body participating in the operation. We need to change this. if you hover your cursor over the vertical row of four buttons down the center of the dialog box, click the one that says Cut (second one from top). It should change the green preview to red, indicating a cut operation. 

 

 

 

 

 

iLogic Tutorial for the iDoor-Three Page Five Image 03 - The Sweep Preview

The Solids selector should now be active. You now need to add both rails and the other stile to the selection set. it should look like the image below. If so, click OK to accept the settings and create the sweep.

 

iLogic Tutorial for the iDoor-Three Page Five Image 04 - Select the participating solids

 

- iLogic Tutorial Three Navigation -


Intro
12345678910