01 AUTODESK INVENTOR ilogic ( Tutorial Info )

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to our course about inventors I logic let's begin by creating a new part we'll use a metric part I'll use the standard part file in millimeters click projects you see that we're working in an IEEE logic project let's click done and let's click create before we get rolling let me just say a few words about AI logic this is a utility Inventor provides you for creating custom script to work with inventor it's basically rules based design in other words you can build your own custom intelligence into your model in this tutorial I'll show you a simple example of how I logic works let's begin by inserting a sketch now let's create a rectangle here I'll make it 40 tap by 20 millimeters press escape to exit let's rename our dimensions now right click on the dimension select dimension properties this dimension will be called length let's click okay right-click on the other dimension dimension properties and I'll name it width click OK and exit the sketch in command a 10 millimeter depth is fine let's click OK click on this face actually let me make that last dimension visible first let's right-click on extrusion one show dimensions now select the dimension and select dimension properties name this dimension height and click okay remember we could also rename the dimension from the parameters window here's our dimensions let's close the parameters window and now let's go create some rules in AI logic the AI logic panel can be found on the manage tab a drool first we name the rule I'll accept the default name click ok the Edit rules dialog box is now open now at this point in the course I'm not going to go deep into programming script I'm just going to show you the principle so you get the idea of how this process works let's right click on extrusion 1 and select capture current state here we've got some simple code the first line of comments any line that starts with a single quotation mark or an apostrophe is ignored by inventor comments are where you can put explanations or some useful history that you might want to look at later it's a good idea to comment your code well otherwise a few months down the road you might open this code and have no idea what you did here so remember a commented line of code will begin with a single quotation mark or apostrophe notice that when you comment a line it appears in a light grey font in italics in the next line you see feature dot is active here's the name of the feature and equals true in other words if this feature was suppressed it would become unsuppressed with this code if I type false instead of true here it means that extrusion one will be suppressed next line we see the length equals 40 millimeters the width 20 and the height 10 millimeters let's change the length to 60 millimeters and click okay nothing's happened but let's click update and you see the update now the model has a length dimension of 60 millimeters let's open the eye logic browser here's the rule we just created rule zero let's double click on it to open it get back to the Edit rule window let me highlight and copy this line and I'm going to paste it down here change is active to color as you noticed I typed it with a lowercase C Visual Basic is forgiving for this type of mistake when I save this rule it's going to correct me automatically okay next let's type in an equal sign after the part name extrusion one now double quotations and let's type our color value within the double quotations red as you see I have double quotations here but not here that's because here I'm dealing with a boolean variable and down below I'm dealing with a string click ok double click on rule 0 to launch the editor again as you see inventor did indeed correct my syntax before changing the color to red let's incorporate the message box function so I type in message box dot show open the parentheses close the parentheses and pair of double quotation marks within the parentheses a message box is what makes a program message in a dialogue window like a warning or confirmation or a pop-up now I'm going to type what's called my argument let's type my message , a pair of double quotation marks the next argument will be the title in the message box window I'll call it title let's click OK to run our rule here is the message box with the title let's click OK and let's edit the rule again I'm going to add another line copy this line here click and copy let's paste it here right click and paste or ctrl V let's change the color to gold instead what'll happen now is that our feature will change color to gold a message box is going to pop up and when we click OK the box will become red let's test it out click okay now our extruders gold let's click ok now it turns red by the way you don't have to run the rule from the editor window you can just right-click on the rule and select run rule here our extrusion is gold let's click OK and it turns red double-click on rule 0 to edit it again now let's incorporate the input box function I'll right-click and copy this line of code ctrl V to paste it below instead of message box I'm going to type input box let me explain a bit more about what I've done here the eye is a variable the message box is the function that shows the user a message box and waits for a user to click a button so in my example the user that's me had to click OK this function returns an integer to store inside variable a the input box is also a function but it does something different it waits for the user's input and then returns a string and now variable I will store the stream in the next line let's replace the value in the parameter length I can copy and let's right-click and paste we'll replace the value in length with the value stored in the input box we might have a little problem here since the values a stream but the parameter length is what's called a double in order to avoid any trouble I'm going to use what's called the CD BL function this is a function that converts the string data type to a double data type let's run our code click ok the extrude is gold here's the message box click okay turns red here's the input box let's enter a value let's say 20 millimeters and let's click OK as you see nothing happened so let's click update and here is our updated model let's add another line of code I'm going to type I logic VB period update when done space equals space and type the word true this last line of code will update the model for us without our having to click update now let's input a length value 45 click OK and the model updates without our having to click update if you happen to be familiar with Visual Basic by now you're going to understand that that's the programming language we're using in a logic technically speaking we're using visual basic.net if this is your first time programming you might be thinking there's no way I can type all of this stuff by hand well the good news is that hand coding is kind of a thing of the past i logic lets you do all this coding without knowing the syntax in the left-hand panel of this browser window are all the snippets of code that you're going to need to make modifications in our next few tutorials will be learning about some of the things I talked about here data types variables etc and this concludes our first tutorial about AI logic
Info
Channel: Video-Tutorials.Net
Views: 15,581
Rating: 4.9499998 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
Id: oCAb8oyb-w8
Channel Id: undefined
Length: 11min 0sec (660 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.