Inventor 2011: iLogic für Dummies (AU2010)

Page 1

MA316-1L iLogic For Dummies Chris Hall – Autodesk Doris Fischer – Autodesk iLogic enables rules-driven design, providing a simple way to capture and reuse your work. Use iLogic to standardize and automate design processes and configure your virtual products. In this class, we will cover the fundamental building blocks for creating iLogic rules in Autodesk® Inventor®. The concepts and principles covered are focused on the average Autodesk Inventor user. We will start with a simple rule, and continue to build upon this rule, increasing the complexity of the rule as we progress through the class.

About the Speakers: Chris Hall, a Technical Marketing Specialist, joined Autodesk in February 2006 through the acquisition of Alias. Prior to Autodesk, Chris worked as Lead Consultant for Alias delivering services to Automotive and Consumer Product clients. He has 20 years of overall Industry experience that spans across multiple disciplines of design. Email Address: chris.hall@autodesk.com. Doris Fischer is an Education Solutions Specialist in Manufacturing for Autodesk in EMEA. In this role, she trains and supports faculty members and students all over Europe. For more than 13 years, Doris has delivered training and presentation experience in the Autodesk Manufacturing space, for beginners as well as high-level end-users, for Autodesk direct major customers in a wide variety of disciplines. Doris first started with AutoCAD® 2.6 nearly 20 years ago, continued with MDT, and then Inventor® starting ten years ago with R2.

1


Contents Setting the Project File .................................................................................. 2 Lesson 1 - Create and Modify Parameters on the Wrench Bar...................... 3 Lesson 2 - Add Parameters to the Pipe Wrench Assembly ........................... 8 Lesson 3 - Adding iLogic Rules to the Wrench Bar..................................... 10 Lesson 4 - Create a Rule for Feature Suppression by Size ......................... 14 Lesson 5 - Create a Rule Using the Wizard ................................................. 19 Lesson 6 – Create a Rule to Control a Part in an Assembly........................ 21 Lesson 7 – Import of Parameter using XML ................................................ 26

2


Setting the Project File 1. Select Project from the Ribbon Bar

2. Select the iLogic_For_Dummies Project. 3. Select Done.

3


Lesson 1 - Create and Modify Parameters on the Wrench Bar In this lesson, you add and modify parameters on the wrench bar. You also adjust the filtering of parameters to control their display in the Parameters dialog box. 1. Open iLogic_For_Dummies_Lesson_1.iam

2. Open the red handle part of the assembly: 

In the browser, select Wrench_Bar_Lesson1:1

Right‐click anywhere in the canvas. Click Open.

3. On the Quick Access toolbar, click the Parameters icon.

4


4. To add a text parameter, click the drop‐ down next to Add Numeric and select Add Text.

5. In the row for the new parameter: 

Under user parameters, enter Part Material for the new user text parameter name.

6. Add a Multi-Value parameter to Part Material: 

Right‐click on the cell in the Equation column. Click Make Multi‐ Value.

7. In the Value List Editor dialog box:  

 

5

Click in the Add New Items area. Enter Cast Bronze, Copper, Gray Iron, Stainless Steel, and Steel. Press RETURN after entering each value. Click Add. Select OK.


8. Modify the parameter wb_Length to Multi‐ Value:  

In the Parameter Name column, select wb_Length. In the wb_Length row, right‐click on the cell in the Equation column. Click Make Multi‐ Value.

9. In the Value area, select 378mm. Click Delete.

10. In the Value List Editor dialog box:   

Click in the Add New Items area. Enter 328, 378, and 428. Press RETURN after entering each value. Click Add.

11. Select the Allow Custom Values check box. Click OK.

6


12. In the Key column, place a check mark in the box next to the wb_Length and PartMaterial parameters.

13. Click Filter and select Key.

14. Click Less. Notice the change in the Parameters dialog box.

7


15. For the wb_Length model parameter, in the Multi‐Value list, select 428 mm. Notice the length of the part automatically increases in-canvas

16. In the Parameters dialog box:  

Clear the Immediate Update check box. In the wb_Length row, click the Multi‐Value drop‐down and select 328 mm. In the BarSplit_Len row, click the Equation column and enter ‐127.

17. Press TAB or ENTER to set the value. To finish Parameters and update the part:  Click Done.  On the Quick Access Toolbar, click Local Update.

18. To change the values for the bar length:   

  

Start the Parameters tool. Select the Immediate Update check box. In the wb_Length row, click the Multi‐Value drop‐down and select 428 mm. In the BarSplit_Len row, click the Equation column and enter ‐198. Press TAB or ENTER to set the value. Click More to expand the Parameters dialog box.

19. Save your file. 8


Lesson 2 - Add Parameters to the Pipe Wrench Assembly In this lesson you add the parameters that will drive the Wrench Size and Jaw Offset. 1. Open iLogic_For_Dummies_Lesson_2.iam 2. Open the Parameter Editor 3. Click Filter and select All. 4. To add the first parameter to our Pipe Wrench assembly, click the drop‐down next to Add Numeric and select Add Text. 5. In the row for the new parameter: 

Under user parameters, enter WrenchSize for the new user text parameter name.

6. Add a Multi-Value parameter to WrenchSize: 

Right‐click on the cell in the Equation column. Click Make Multi‐ Value.

7. In the Value List Editor dialog box:  

 

9

Click in the Add New Items area. Enter Small, Medium and Large. Press RETURN after entering each value. Click Add. Click OK.


8. Add another parameter called JawOffset. Click the drop�down next to Add Numeric and select Add Text.

9. In the Equation column for JawOffset, ENTER 38mm. 10. Save your file.

10


Lesson 3 - Adding iLogic Rules to the Wrench Bar In this section, you create a rule that updates iProperties based on a parameter's value. 1. Open iLogic_For_Dummies_Lesson_3.iam 

In the browser, select Wrench_Bar_Lesson3:1.

Right‐click anywhere in the canvas. Click Open.

2. On the Quick Access toolbar, click Parameters. 3. Review the model’s Parameters:   

Click Filter Select the Key option. Notice the wb_Length and PartMaterial Multi‐Value parameters. The rule to be created deals with these parameters. Click Done.

4. Review what material is currently assigned to this part:  

11

In the browser, right‐click the part file name. Click iProperties. In the iProperty dialog box, Physical tab, notice Material is currently set to Cast Bronze. Click Close.


5. Displaying and positioning the iLogic Rule browser:   

On the Manage tab > iLogic panel, click Rule Browser. Drag the Rules browser so it is docked below the Model browser. To add a rule, in the Rules browser, In Document tab, right‐ click the part. Click Add Rule.

6. In the Rule Name dialog box, enter Set Material. Click OK.

7. Begin to add code to the rule to change the part’s material property: 

  

12

In the Edit Rule dialog box under the System Snippets list, expand iProperties. Select and hover your cursor over the Material snippet. Notice the help that pops up. Double‐click Material to add the rule text area of the Edit Rule dialog box.


8. Complete writing the rule that changes the property of the part: 

 

In the rule text area of the Edit Rule dialog box, enter an equals sign (=) after the Snippet. With the Model tab selected, select User parameters. (1) Note the parameters that are listed to the right of each under the Parameters tab. (2) Select User Parameters group, then double click the PartMaterial parameter to place it after the equals sign in the text area.

9. Click OK to save the rule and close the Edit Rule dialog box. 10. On the Quick Access toolbar, click Parameters. 11. Change the PartMaterial parameter and note the change in the model: 

13

In the equation column of the PartMaterial row, click the Multi‐ Value drop‐down list and select Copper. Note the part’s color changes to match the material.


12. Change the PartMaterial value to the other values:  

Note how the part’s color changes with each selection. In the equation column of the PartMaterial row, click the Multi‐ Value drop‐down list and select Copper. Click Done.

13. Open the iProperties dialog box again to see what material is currently assigned to the part. Notice the material is now set to Copper. When finished reviewing, close the iProperties dialog box. 14. Save your file.

14


Lesson 4 - Create a Rule for Feature Suppression by Size In this section of the demonstration, you create a rule that sets what features should be displayed based on the size of the part. 1. Continue working with Wrench_Bar_Lesson3.ipt (If you were unable to complete Lesson 3 use Wrench_Bar_Lesson4.ipt) 2. Create a new rule:  

In the iLogic Rules browser, right‐ click Wrench_Bar_Lesson().ipt. Click Add Rule. In the name field, enter HandleLength.

3. Add code to the HandleLength rule: 

In the Edit Rule: dialog box, select the If...Then...End If option.

4. Add the deciding parameter.    

15

In the rule text area, double‐click My_Experession text to highlight. On the Model tab, select Model Parameters(1). On the Parameters tab, on the right, scroll down to the bottom of the list. Double‐click wb_Length to replace the highlighted text in the text area(2).


5. Add an operator to the wb_Length parameter:  

In the Edit Rule: dialog box, Operators drop‐down, select the less than sign (<). In the rule text area, enter 378 after the less than sign operator.

6. When the value is below (<) 378 we want to suppress FrontPocket_Slot.   

In the rule text area, position the cursor on the next row down. On the Model tab, scroll down to FrontPocket_Slot. Right‐click FrontPocket_Slot and select Capture Current State.

7. Delete the excess code and set the feature to suppress if the parameter is set to a certain value: 

16

In the Edit Rule: dialog box, enter False after the equals sign.  Delete the lines of code between the current line you are on and the last line.


8. Because the FrontPocket_Slot is suppressed, the design of the handle needs to be split at a different location:   

Position the cursor on the next row. On the Model tab, scroll to the BarSplit workplane. Right‐click and select Capture Current State. Change the distance from ‐198 mm to ‐148 mm.

9. Add an Else statement:  

17

Position the cursor on the next row down. In the rule text toolbar, select Else from the drop‐down.


10. Add code to adjust the model if the If statement above is false:    

Copy the lines of code between the If line and the Else line and then paste them below the Else line. Change Feature.IsActive value to True. Set the BarSplit_Len value to ‐198 mm. Click OK.

11. On the Quick Access toolbar, click Parameters.

12. Change the wb_Length parameter and note the change in the model.  

18

Click the Multi‐Value drop‐down list in the equation column of the wb_Length row and select 328. Note the part's length changes. The FrontPocket_Slot and all features dependent on it are suppressed.


13. Change the wb_Length parameter and note the change in the model:    

Click the Multi‐Value drop‐down list in the equation column of the wb_Length row and select 428. Note the part's length changes. The FrontPocket_Slot and all features dependent on it are unsuppressed. Set wb_Length to 378. Click Done.

14. Edit the rule to add comments:   

In the iLogic Rules browser, right‐ click HandleLength. Click Edit Rule. In the rule text area, above the If statement, enter Rule to change the length of wrench handle. Click the Comment out the selected lines tool(1).

15. In the Edit Rule: HandleLength dialog box, Click OK. 16. Save your file.

19


Lesson 5 - Create a Rule Using the Wizard In this Lesson of the demonstration, you use a wizard to create a rule that limits the range of values allowed for a parameter. 1. Continue working with Wrench_Bar_Lesson3.ipt (If you had any issues open Wrench_Bar_Lesson5.ipt) 2. Create a new rule:  

In the iLogic Rule browser, right‐ click Wrench_Bar_Lesson().ipt Click Add Rule. In the name field, enter BPDiaLimits.

3. Add the parameter that you want to limit:  

In the Edit Rule dialog box, Click Model Parameters(1). In the Parameters tab, scroll down to the BP_Dia parameter (2). Double‐click it to add it to the rule text area. In the rule text area, double‐click BP_Dia text to highlight it

4. Use the Parameter Limits wizard to create a limit for the BP_Dia parameter:  

20

Click the Wizards tab. Click Parameter Limits.


5. In the iLogic Limits Wizard dialog box, enter the minimum and maximum values and adjust the violation messages:   

For the Max. Value, enter 6. For the Min. Value, enter 3. In the minimum and maximum text fields, replace “this parameter” with BackPocket_Slot.

6. Click Apply and Close. 7. Click OK in the Rule editor. 8. On the Quick Access toolbar, click Parameters.

13. 9. Change the BP_Dia parameter:   

Click the Equation column of the BP_Dia row and enter 1. Press TAB or ENTER and notice the warning. Click OK.

10. Change the BP_Dia parameter:   

Click the Equation column of the BP_Dia row and enter 7. Press TAB or ENTER and notice the warning. Click OK.

11. Click Done. 12. Save your file. 21


Lesson 6 - Create a Rule to Control a Part in an Assembly In this Lesson, you create a rule based on the value of a single parameter in the assembly that controls the size of one part and the color of another part. 1. Open iLogic_For_Dummies_Lesson_6.iam

2. To change the wrench size parameter:   

Start the Parameters tool. In the Parameters dialog box, notice the WrenchSize Multi‐Value parameter. In the Equation column of the WrenchSize row, click the Multi‐ Value drop‐down list and select Medium. (Nothing will happen). Click Done.

3. To add a rule:   

22

On the ribbon, Manage tab, iLogic panel, click Add Rule. In the Rule Name dialog box, enter JawColor. Click OK.


4. Add a rule to change components based on a parameter case. 

In the Edit Rule dialog box, Keywords dropdown list, click Select Case.

5. Add the deciding parameter:    

In the rule text area, enter a space after the "Select Case" text. On the Model tab, click User Parameters(1). On the Parameters tab, click WrenchSize(2) Double‐click to place the WrenchSize parameter in the rule text area.

6. Add the first case clause:    

23

Position the cursor on the next row down. In the Keywords drop‐down list, click Case to add it to the rule text. Enter “Medium” (be sure to include the quotation marks). Press ENTER.


7. Add code to change the color of the Jaw component:    

In the Snippets list, on the System tab, click to expand Components. Hover your cursor over the Color snippet. Notice the help tip that is displayed. Double‐click Color to add the rule text area.

8. Specify which component to change and what color to change:  

 

24

In the rule text area, highlight PartA:1. On the Model tab, click DS51F1496‐04_iLogic:1. On the Names tab, double‐click DS51F1496‐04_iLogic:1 to replace the highlighted text in the text area (2) Position your cursor at the end of the line. Enter = “Blue” (be sure to include the quotation marks). Press ENTER.


9. Add code that changes a part’s size based on a parameter:  On the Model tab, expand Wrench_Bar_Lesson6:1  Under the expanded part, click Model Parameters.  On the Parameters tab, scroll to the bottom of the list.  Right‐click wb_Length. Click Capture Current State. 10. Clean up excess code:  

In the rule text area, click to the left of a row to select the entire row, as shown. Press DELETE to remove the text.

11. Add another case clause:         

25

Position your cursor on the next row down. Press and hold SHIFT and press UP ARROW three times. Right‐click the selection. Click Copy. Position your cursor on the last blank line. Press CTRL+V to paste the copied code. In the code you pasted, double‐click Medium. Enter Small. Double‐click “Blue” and enter “Yellow”. Double‐click 378 and enter 328.


12. Add a third case clause:      

Position the cursor on the last blank line. Press CTRL+V to paste the copied code. In the pasted code, double‐click Medium. Enter Large. Double‐click “Blue” and enter “Green”. Double‐click 378 and enter 428.

13. Complete the Select Case statement:  

Position the cursor on the last blank line. In the Keywords drop‐down list, click End Select.

14. In the Edit Rule dialog box, click OK. Note the jaw part turns blue. 15. Test the rule:   

Start the Parameters tool. In the Equation column of the WrenchSz row, Multi‐Value drop‐ down list, select Small. The handle size is changed and the Jaw becomes yellow in color.

16. Test the large handle size: 

 

Select the Multi‐Value drop down list in the equation column of the WrenchSz row and select Large. The handle size is changed and the Jaw becomes green in color. Click Done.

17. Save your file.

26


Lesson 7 - Import of Parameters using XML In this lesson, you export existing parameters from a part file to an XML file. You then import the parameters in the XML file into the existing wrench assembly file. 1. Open iLogic_For_Dummies_Lesson_7.iam 2. To import parameters into our assembly. 

Click Manage tab > Parameters panel > Import from XML.

3. In the Import Parameters from XML dialog box, navigate to, select, and open PartMaterials.xml. 

Located in the _Data/Assemblies Directory

4. Open the Parameters dialog box. Review the list of user parameters. Notice the newly added parameter 5. Add a new rule to our Assembly that will allow us to change the Part Material of the Pipe Wrench bar at the Assembly level.  

27

In the iLogic Rules browser, right‐ click Wrench_Bar_Lesson().ipt. Click Add Rule. In the Rule Name dialog box, enter PartMaterial.


6. Add the code that will change the part material at the assembly level.        

On the Model tab, expand Wrench_Bar_Lesson7:1 Under the expanded part, click User Parameters. On the Parameters tab, click PartMaterial Double‐click to place the PartMaterial parameter in the rule text area. Position your cursor at the end of the line and place an “=” On the Model tab select the User Parameters of iLogic_For_Dummies_Lesson_7.iam Double‐click to place the PartMaterial parameter in the rule text area after the equals sign. Click OK.

7. Test the rule:   

28

Start the parameters tool In the equation column of Part Material row, Multi‐Value drop‐down list, select Stainless Steel. The handle material is changed and becomes Stainless Steel in color.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.