61 AUTODESK INVENTOR ilogic Tutorial Save

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back we're wrapping up this course on inventor I logic in this tutorial we're going to learn about incorporating the save as and save copy as commands into our algorithms let's start by creating a rule right click add rule accept the default name expand the document branch double click on the file save as snippet let me highlight the path and the file name and the second argument is a boolean true/false so if it's true the file will save as a copy and if it's false a save as operation will run let's replace the first argument here got a few different snippets we can use there's path filename path and file name change extension workspace path etc for this example I'm going to use the path and the file name the argument here allows us to use or not use extensions if the value is false the extensions won't be used we're saving a copy of our file we specify a name we'll do that within double quotations for example - zero zero one dot IPT now let's click ok and see how this command works visually nothing has changed but the file with the new name was saved let's double-click on our rule to open it for more editing I'm going to expand the logic a little bit first I'm going to incorporate an if statement now let's place this line inside the if statement in the evaluation statement I'm going to use the doer function space equal space empty string this function returns its string which represents the name of the file the directories volume and so on let's copy our first argument and let's place it right here the logic is going to go like this if the dur function returns an empty string it means the file doesn't exist so then this line of code will run a new file of the name specified is going to be saved to cycle through the existing files I'm going to incorporate a do-while loop let's begin by declaring and initializing a variable dim AE as integer equals one here I'm going to type in do-while I is less than a hundred and down below i'll type in loop let's add a line before the loop tag I equals I plus 1 otherwise we'll end up with an infinite loop as you may remember from a previous tutorial on this topic next we need to change the name of our part and let me show you how to do this going to use a variable I but as you see we have some issue here right now we're using a three-digit number it's got two zeros before the number one but as you see above I is a single digit number one let's declare another variable dim a as a string now let's type a space equal sign space I period to string and I'll open in close some parentheses so the argument will be within the parentheses and within double quotations d3 what this function does is convert our numeric value to a string we've also got the ability to specify the number of digits that's three in my case you can choose a different number here for example two will give two digits when the original number is less than three digits the function will add a zero in the place of the missing digit now let's incorporate the variable in the part name argument oops I missed the ampersand here copy this part of the code and paste it below next I'm going to bring in a message box to notify the user that the file was saved let's type file was saved as our message and let's copy this argument and paste it within the parentheses space ampersand space let's remove this final double quotation mark lastly here after the code in the if statement runs we need a mechanism to exit the loop here I'll type I equals 100 or I can type an exit due statement and let's test our code click okay you'll remember that we already had a file with name zero one zero zero one so the program saved - zero zero two version click okay now when you save to a new file you want to control some other parameters like file name title descriptions and so on so let's take a moment to figure out how we can set that up to go to the parameters window let's create a few user parameters there'll be text parameters this one part number another one for title and one more we'll make it true false save copy as and that's so we can control whether we're saving a copy of the file or saving it with some unique file name and we're done with the parameters window let's click done now let's create a form go to the forms tab right click and select add form first let's drag in a group drop it here change the name I'll call it dimensions now I'm going to bring in the length height and width parameters let's just rearrange them down below I'll bring part number title and save copy ass let's change the labels to get rid of the underscores now select the form and scroll down the property manager let's select predefined buttons okay cancel and apply let's click ok and go back to our rule click on rule zero to open it up we're going to add a couple lines of code here I properties double click on part number space equal sign space user parameters double-click the title snippet now space equal space title now let's go to user parameters parameters let's bring in length and percent Haight next space ampersand space double quotations and with and let's close the parentheses open parentheses and a space lastly we need to change the second argument in the save as function so that we'll have the ability to save copy as let's bring in the save copy as parameter and let's click okay inventor saves copy number three here let's click okay and let's go to forms click on forum 1 here it is here we're going to take a look at a logical issue first let's change the dimension I'll make it 45 by 45 by 45 let me type in some text for the part number my part number my title I'll type in my title now when I switch save copy as from true to false watch what happens currently the file name is 0-1 let's click apply so the file has been saved but look at how long the name is getting now as you see now the name gets longer every time we save it in this way so this will quickly get unwieldy let's fix this problem close the form and open the rule what I'm going to do is remove this part of the coat and here as well zero-one zero-one here also be sure you haven't missed anything like here now I need to add a backslash in front of the file name one more and let's test out our code click okay so here's our new file this concludes our tutorial about incorporating save commands into your AI logic work
Info
Channel: Video-Tutorials.Net
Views: 1,143
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, Save
Id: SO1XSEnpnQs
Channel Id: undefined
Length: 11min 36sec (696 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.