59 AUTODESK INVENTOR ilogic Tutorial ( Rule Arguments )

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back in this tutorial we're going to take a look at an advanced method for passing values between rules let's begin by creating two rules I'm going to right click on my part and select add rule except the default name and let's add another rule okay as well alright let's open rule zero expand the run other branch double-click on the run rule snippet here's the argument name and here's the argument value let's rename rule name rule one and click OK now let's open rule one and let's type A equals expand the run other note double click on rule arguments let's delete this part of the code this function retrieves an argument that's passed via a named value now let's bring in the message box function I'm going to expand the message box node of the tree and double-click on the show snippet let's replace the message with variable a now pay attention to what's going to happen here since I didn't run rule 0 argument 1 doesn't exist let's click okay we're going to end up with an error and here it is click okay let's see how we can fix this first of all the air is not in this line but in this line here prove it let's comment out this line and click OK no problem so we know the problem occurs when a equals nothing to avoid this error let's bring in an if statement and I'll bring this line of code within the statement the evaluation statement is going to look like this if a is not equal to an empty string then this line of code here is going to run click okay and check it out since the variable a doesn't store any value my message box doesn't appear let's run rule zero right click run rule and here's our message box argument one value let's click OK and let's make some more modifications to rule zero let's declare the variable here Dimmie as integer and the next line a equals five now we'll use the add method let's copy this line here and let's paste it below with a control V argument to argument will replace with variable a so in a nutshell the second argument will store the value pass to this argument through variable a let's click okay to test it out and let's modify our second rule now let's copy our first line of code right click and copy let's paste it here variable B argument to let's modify the evaluation statement here we're going to use the and and then is nothing function open and close parentheses and within those type the variable B let's add a logical operation note not open and closed parentheses let's change the message box message a space equal sign space double quotation space ampersand space a space ampersand and then the carriage return live feed constant space ampersand space open quotation B space equal sign space closed quotation space ampersand space B so let's review our logic if a is not equal to nothing and B now here it's a little bit more complex if this function returns a false value which means variable B holds some value then the not logical operator will reverse the boolean value from false to true so basically we end up with if a is equal to something and B is equal to something then this line of code is going to run let's click ok and let's see how it works right click on rule zero run rule here's our message box let's click OK let's modify rule 1 a little bit more I'll copy the if statement and I'll paste it below with a control V let's change the title to a message box one and I'll copy and paste at below messagebox to hear I'll replace this comparison statement here copy and paste it here so here we're evaluating whether or not argument one has been passed to this rule or not and is numeric then variable B within parentheses what we're doing here is checking if argument one is passed to this rule and if the value stored in variable B is numeric now if both sides of the evaluation statements are true then this line of code will be executed let's test it out click okay right click on rule 0 run rule here's our first message box let's click OK and here's our second message box click okay again this concludes our tutorial about using rule arguments
Info
Channel: Video-Tutorials.Net
Views: 664
Rating: 5 out of 5
Keywords: AUTODESK INVENTOR ilogic Tutorials, AUTODESK INVENTOR ilogic free Tutorial, AUTODESK INVENTOR ilogic video Tutorials, AUTODESK INVENTOR ilogic tutorials for beginners, AUTODESK INVENTOR ilogic course, AUTODESK INVENTOR ilogic full course, AUTODESK INVENTOR ilogic training, AUTODESK INVENTOR ilogic courses online free, best AUTODESK INVENTOR ilogic tutorials, best free AUTODESK INVENTOR ilogic tutorials, free INVENTOR ilogic tutorials, video-tutorials.net, Rule Arguments
Id: Yg23jckgQx0
Channel Id: undefined
Length: 7min 9sec (429 seconds)
Published: Wed Apr 08 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.