Enhancing iLogic with Windows Forms | Autodesk Virtual Academy

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right let's get started here uh first and foremost welcome to autodesk virtual academy brought to you all by your friends here at cative technologies my name is nigel umbaek one of the customer success managers here on the kativ team and today i'm joined by my good friend cameron wetton cam how's it going it's going great nigel great to hear cam uh and if you didn't already know cam's been on ava a number of times uh dabbling a lot in the inventor and automation for inventor space he's one of our aes here at catib working on our services delivery team uh working on plenty of automation projects for our customers i'm sure cameron will talk a little bit about that moving forward so today we're going to be going over enhancing ilogic with windows forms so just another automation webinar it's been like the really hot topic over the last i would say 12 to 18 months we get a ton of requests for it so uh you know we'll deliver on those requests if anyone has any questions at any time during the webinar uh go ahead and type those into your respective chat or questions panels and we'll go ahead and address those but uh cameron before we get started do you have anything else to add nope that's great cool i'll let you take it away and um what i'm gonna have our marketing people do right now is go ahead and post a link to a survey uh that you can go ahead and open up right now or at the end of the webinar to go ahead and just answer a couple of questions for us so you'll see that in the chat panel shortly uh go ahead and fill those out that helps us determine what sessions we do in the future but without further ado cameron go ahead and take it away all right thanks nigel so yeah today we're going to be talking about enhancing ilogic with windows forms now as many of you know maybe some of you don't ilogic is a powerful tool for automating your inventor designs and ilogic forms are great for creating a user interface for your automation and most of what you will need can be done with the built-in form functionality inside of inventor but sometimes you need something more advanced so today we're going to cover what to do when you need more advanced user input so we are going to cover we're going to learn how to set up an ilogic rule to interact with a custom windows form and specifically we're going to make sure we cover how to display a custom windows form to the user how to send data to the form from an ilogic rule and how to receive user inputs back from the form so that you can use them for other things inside of your ilogic rule and to do this we're going to go over an example of a custom form that i've made and a rule that uses that form so let's go ahead and switch over to inventor and i've got an assembly here a simple assembly doesn't have much to it it's got a couple of brackets these are the same part there's just two occurrences of it in this assembly and then this other little part that's floating out here and inside of this assembly i've got just a handful of user parameters most of them are numeric type and then one text parameter and what we're trying to accomplish with this assembly is like nigel said i'm i'm working on the automation team here at kativ and we work on a lot of projects for our customers to [Music] uh build automated assemblies so there's there's some kind of a form or input where the user can you know specify the parameters or the the properties inputs for that assembly and then we've got code that actually creates the assembly automatically according to what the user is as specified and a lot of times that involves having an assembly with lots of parameters in it and then those parameter values could need to get passed down into different components inside of the assembly so that those components can resize and reposition themselves according to the user input and so the way we set that up is a lot of times we'll have our assembly that has a whole bunch of user parameters in it and then we'll have to go down into our par files and make sure that those same parameters are set up in those part files so that when they pass the when the assembly passes those values down the part files no are ready to receive those values and then adjust themselves work with those values and most of the time we have to create the the parameters in the assembly and then if i want these same parameters in a part file that i have to go down into the part file open it up and then you know maybe i take a screenshot of my parameters in my assembly go down into a part open up the parameters and then manually start typing okay i need a numeric parameter named length z and then add a numeric parameter length x etc and i have to create these one by one and you can imagine if there's a lot of parameters then and a lot of components that need those parameters that can take a lot of time and so i thought in order to speed that process up for myself what i would do is i would create an ilogic rule that would essentially do that for me i'd create the parameters manually at the top level and then i would have my ilogic rule would copy those parameters down from the top level assembly into the sub components and so i did that and it ended up saving me tons of time um and there were a couple limitations with it i it for one it just mostly just copied every parameter that i had user parameter that i had on my assembly copied it down to a single component that i've selected and that wasn't always something i needed sometimes i didn't want to copy all the parameters sometimes i want to just choose specific ones that need to go down to a specific component and there were also times where i needed to maybe copy it to multiple components at the same time and so um so the next thought i had was okay that's going to require some user input i have to tell the program these are the parameters that i want to copy and these are the components i want to copy it to and so i needed some user input at that point so my thought was i've got my rule that copies the parameters i'm going to need a form for input to choose the different parameters and components and so okay first thought occurred to me was let's just create an ilogic form using the built-in functionality and i've been able to do a lot with this stuff you can you can create some pretty good user input forms for inputting parameters and all sorts of stuff and properties with the built-in ilogic form functionality but what i really wanted was to be able to have the form to have a list of different all the parameters and a list of all the components with check boxes that i could choose for each one and there's not a way to do that inside of an ilogic form there's just no control that'll handle that sort of input so that was when i realized okay i've got to go outside ilogic and build a custom windows form to be able to do that and so that's what i did and i've got this copy parameters rule i'll go ahead and run it so you can see the custom form that i created it essentially the ilogic rule goes through gets a list of all the components in the assembly and a list of all the parameters in the assemble the user parameters in the assembly and then just writes them out into these two different lists and now i've got check boxes that i can use to choose which ones i want to copy and which components those will get copied into and i've also added some functionality where i can uncheck and recheck all and then i can choose to copy the parameters from there i've also got some you know some icons here to indicate whether it's a part or an assembly and then also some icons here to represent the different parameter types these orange ones are numeric the gray ones text and then i've got another one for a true false parameter which i'll show you in a minute so the idea is here i need this user input i but i couldn't do this for iologic forms i had to do this for a windows form so let me go ahead and show you an example if i add a true false and go back and run that again it's going to go through collect the user parameters now let's see now it sees that there's a new one and it's a true false so it's got a different color so so this is what i wanted to do and today we're going to go over how i accomplish that so what i used to build this form was is i liked er microsoft visual studio and because that's what i use in my day-to-day work but um so you can use visual studio or any other developer environment that lets you build windows forms and as long as it has the functionality that you need and as long as it compiles the form into a dll that's really all you need to be able to make this work so i'm going to go ahead and switch over to visual studio and we'll talk about the form now we don't have enough time today to go over a tutorial of how to build a form in visual studio there are lots of resources out there on the internet for lots of tutorials for building windows forms so go ahead and check that out there's even on the autodesk website the inventor customization forum is a great place to learn how to do all this kind of stuff in fact i think one of their their their pinned posts one of their sticky posts is uh how to build your first plugin and it goes over building a simple form and how to plug it into inventor um so that's a that's a great resource for learning how to build a custom windows form so what we'll highlight today is just the the high points and the important points to set up inside of your form so that you can make sure that it's ready to plug into ilogic okay so the idea here is you start your solution in visual at least in visual studio you start your solution and create a project for your code and then you want to add a windows form so either right click on your project and go to add new item and then it'll pull up a list of different items you can add and one of the ones will be a windows form or you can just pick it directly off of here so here forum windows forms so you add that to your project it'll ask you to give it a name and that'll be important you want to choose a name that makes sense and that you can remember for later because that's going to show up in how we link this up through ilogic we'll we'll be making use of what the name that you give it so we'll talk about that more later so you create your form and that's going to come up with just a blank form that doesn't have anything in it you'll want to add your controls to it by going to your toolbox picking the things you want dragging them over so if you want some buttons you just click the button drag it over drag another one over if you need labels that's this text here you just it's called a label bring it over this box here that i'm using to list items and have checks check marks next to them is called a list view so i pulled that over and then here's a check box you pull that over um once you've got your control excuse me once you've got your controls placed then you need to configure them by just selecting your controls and going to your properties there's lots of different choices you have here to set up how this control behaves what it looks like so the text is going to be what the button shows right and then the name is an important thing here we'll want to the controls that we're going to be interacting with in our code later we'll want to give those a name and so yeah so you get all that set up the way you want and then what you want to do once you've got your form set up you have to be able to tell the form how to behave so you've got to be able to write some code to tell it what to do so for example this functionality over here where i run this and i hit this checkbox when i mark this then it marks all these like it doesn't automatically do that i have to write the code to tell it to do that and so there's going to be some code behind the scenes of this form of telling them what to do and to see that you go to your solution explorer and you expand that form and right here is going to be the class code that's behind that so i've selected that and here's here's the class and the class name is gets that name from whatever you named the form and that's what's going to be important later when we link this up to ilogic but here's basically just a list of properties and methods that control how the form behaves and i'm not going to go through most of this but the important parts are going to be this section here is what happens when the form actually gets loaded for the first time if we want it to run specific bits of code that's where we put that code and so for example we want to do when that form loads we want it to be able to show build the list of components and parameters we wanted to fill this list out to present it to the user and we want that to happen on load so that's where we place the code to do that and then of course when we hit the button to either cancel or to proceed with the copy that we have to tell write the code to tell the form what to do when the user does that so this little section here is when the copy parameters button is clicked and you'll see this is where the naming the com naming the controls becomes important so this control here name is called button copy parameters so i know what this function does if if we just stick with the default names i'll just say button one click and button two click and it can be confusing what exactly those are so that's why it's important to give them a good name so you go over to properties name there it is right there button copy parameters so that's what happens when we click that button it's going to run this code and so we'll talk about these two here in more detail the rest of the stuff there's a cancel button that's important when they hit cancel we want it to close and this dialog result is going to be important later when we link up to ilogic we want to be able once the form the users input some data into their form and click the button either cancel or uh copy parameters button we need to know in iloc theologic rule needs to know which button the user picked and so we're using this dialog result property to keep track of that so we do make sure when they click the cancel button that we set this dialog result to cancel and then close it out or if they hit the copy parameters button then we need to know they hit that instead so we set the dialog result to okay and then close it out and then i'll show you later how we link that up in the ilogic rule okay so let's go into a little more detail of what's happening here in order to actually get this form to work we've got these four properties that we've defined up here inside of this class these two properties here are the are lists of the component list of components and a list of parameters that are going to be inputs to the form which basically ilogic builds the list of components in the assembly and the list of parameters in the assembly and then it passes those lists over to the form and the form stores them in these properties and these are a list of object so that's how we get the initial list to display to the user and on the form load what we do is we have the code go through okay for every item in this list it's going to loop through and do some code and each item in that list is it's a string array and i've set that up so that we can actually pass two values over we want the component name and the component type whether it's a part or an assembly and i'm passing those over as a single line item in this list and i do that by building a string array with those two values so the first element of the array index 0 is going to be the component name the second element of the array is the component type and okay so now that we've extracted the values of from the array then we need to actually build the list item the item that actually is going to show up in this list right here so we define that as a list view item we add it to the list and we give it the component name that's the text that's actually going to show up in the list and then we need to set the icon type based off of the component type itself so we just select okay if it's an assembly then we use i'm using an image index here to keep track of my different icons and i can easily select which icon to use for this particular list view item and i don't really have time to go into that but uh if you want some more information about that you can just google this image index and an image list on the form is how i'm taking care of that so based on which type it is i choose which icon to use and then that's it and i loop through each item in the list that got passed over from my logic and that builds our component list now we do the same here for the parameters list we again the parameters are being passed over as a string array because i want to keep track of the parameter name and also the parameter type whether it's uh numeric text or true false and so the first element of the array is the parameter name so i extract that second element of the array is a parameter type so we extract that build the list to view item just like before and except this is in the list view for parameters instead of the list view for components and that's the the name of this control right here this list view control and that list view control so i'm adding to this parameters list view and i'm giving it the parameter name so that'll be the text that shows up and then i want to choose the icon based off of the parameter type whether it's numeric text or boolean it chooses which is the correct icon to display for that so that's what happens on form load it basically just builds a list in order to display the information to the user and then once the user goes through and makes their picks they check which parameters they want check which components they want then they either hit cancel and close everything out or they hit copy parameters and when that happens we need some specific things to happen as well so we write some code here what we want to do is take the selections that the user made and pass that those selections back to ilogix so that we can do further things with them actually do the copy of the parameters so that's what this little bit of code here collects those lists of the user that the user selected for uh so there's our list view components and we go through all the checked items and for each checked item that they've the users selected we add it to this component names list and we just add the the text which is going to be the name of the component that they selected so this component names list is a separate list that we've created up here so we've got these two properties for the input lists and these two properties for the output lists so and these are just a list of string because we're just passing back component names and parameter names um so we set those up here and these are this will be important for linking the data back into i logic and i'll show you late in a bit how that all that works but essentially these are the lists we want to build to output the user selections and so that's what this does it just loops through each of the checked items adds each checked component to the list adds each check parameter to the parameter names list and then we're done so we say the user hit the ok button and then we close out the form and then that's essentially it this other code down here is for you know controlling the when when you hit the check all button like here then it uh you know checks all the all the boxes and stuff like that and then i've got also some sorting for clicking on the column headers and then just some controlling how the different uh controls are resized but we don't really need to go into that tangential to what we're talking about today so all right so that's our form that's how we set it up um oh one other thing that's important is we need to actually compile this code into a dll file that we can reference from ilogic and that's the important thing you want to compile it is a dll so you want to make sure when you set up your project let's go take a look at a couple of important properties you want to set up in your project in order for this to work correctly so i right click on my project hit properties one important thing is that is going to come up when we link this to ilogic is this root namespace so you'll either want to change that to something that makes sense to you or just make note of what it starts out as we'll be referencing that in a moment when we link it up to ilogic we also want to set this up as a class library that's what tells this visual studio to compile this as a dll then we want to take a look at the compile tab and see what our output path is so when we actually do this build and it creates a dll where is that file going to end up want to make note of that and so here it's going to be in my actual visual the same folder that my actual project and solution are in and then a subfolder bin and debug and then it'll be in there when i build it okay so now that we've got all that then we'll go ahead and go up to build and hit build solution that's going to uh create the dll i'm not going to do it now because i've already got inventor open and inventor's already looking at that dll so when i if i try to build it it'll just say hey i can't do this it's already in use by another program so when you do it you want to make sure you have inventor closed and then you hit build solution and then that's going to compile so if we go and take a look at here's the folder that has my solution in it my visual studio solution underneath there is my visual studio project copy parameters and inside of there is going to be this is also where i keep the icon images that i use and then underneath that's the bin folder there's that debug and then there's the file that gets created copy parameters it's going to have the same name as this file right here this copy parameters uh oh no it doesn't have the same it follows the class follows the class name no it doesn't must be the project anyway that's the one we want to look at copy parameters.dll might actually be the name namespace okay so once we built it now we're able now we're ready to link it up into our ilogic rule so let's go take a look at that switch back over to inventor and here's my rule now this is a a simplified version of the real thing there's a lot more that goes into setting up a rule like this and making sure that it works correctly but i've basically boiled it down to the important points for what we're covering today of linking in an external custom windows form so the basic idea is here we've got um this section here which actually builds the list of components that are in the assembly and it also goes through and make sure because we have there's actually two bracket components we don't want that to show up twice in the list that's presented to the user because they're the same file they're just two occurrences of the same thing and so we go ahead we just have a little bit here that uh set this up so that it only if it's already been placed in the list it doesn't place it again so it just basically returns a list of unique components so that's what this section does we'll talk about that in more detail and then this section here is what builds the list of user parameters in the assembly and then once we've got both of those lists we're ready to uh use the custom form so we set up a couple parameters here or a couple variables and then this block here is kind of the star of the show this is where we're actually loading up the dialogue sending it the the two lists that we've compiled waiting for user input and then when once the user is finished with the forum it sends the lists of selected values back and then we go on and do stuff in this case we would actually perform the copy of copying the parameters from the assembly down to the sub components but that's a huge chunk of code that we definitely don't have time to go over so i've basically just it's not really doing anything except i've added some simple uh reporting here where i just built a text string that shows us these are about the components the user selected and these are the parameters that the user selected so that we can actually see what values we're getting back when we run this in a minute so all right so let's go to a little more detail of what's going on here so the most important thing is going to be this ad reference at the top this line of code lets inventor know where it can find the form that we compiled our external form that we created so this is going to be a full path reference to that dll file we created so here you can see the path we've got this add a reference keyword that's a visual basic keyword that lets it know we're adding a dll in we've got our full path so there's the path for my visual studio project there's that bin slash debug and then this is our dll that we compiled okay so once it's got this reference the dlln knows how to find that form and it can find all of the classes and properties that we've set up in that form and this ad reference line of code goes at the very top of your rule you can see it's actually in this separate header section so if i can toggle that header on and off that's where that ad reference will go basically needs to be at the top most recent versions of inventor have this separate header section if you have an older version of inventor that doesn't have a header you just need to make sure that this is at the top of your rule you can add comments above this that's fine but otherwise this needs to be at the very top of your rule okay so now that we've set up a reference then let's take a look at how we're compiling that list real quick first of all we just dim up the components list as a list of object because again we're putting the the the list items that we're putting in there are going to be string arrays and so we need to it's just listing it's looping through all of the occurrences in this assembly it's grabbing the component name and then doing this check to make sure we just add unique ones and not duplicates and then down here we're grabbing uh the component type and we're actually adding to that components list we're dimming up a new string array that has the component name is the first element and then the component type is the second element so if i switch back to visual studio here you can see that's what's going into this components list here and we've set it up so the first element is the component name the second element of the array the component type and this assembly and part values are what i'm reading so that needs to match exactly what i'm setting up right here assembly and part so i detect what type it is just by looking at the part or the the component document and based on that i set whether it's assembly apart set that string over build that list to the whole list of components in the assembly and then the next thing is to build the list of user parameters so same ideas i set up this parameters list as a list of object i loop through all of the user parameters in the assembly and grab the parameter name and then depending on what the units type are whether it's text or boolean then i can grab the units into the parameter type or if it's neither of those then it's numeric so i just put that into the parameter type and then again i'm building a string array where the first element is the parameter name second element is the parameter type and then again that corresponds to what we've set up over here in our rule here first element of the array is the name second is the type and then the type this numeric text and boolean when i go to check the type that was need to match up with what i'm sending over here text boolean or numeric okay so that builds up our parameters list now we've got both of those lists we're ready to launch the dialog we're going to create a variable a boolean variable to let us know if the user actually clicked the ok button which on the the dialog is that we named it copy parameters but that's essentially the ok button letting us know that we're good to proceed with the rest of the rule and i'll show you how we use that and then we've also dimming up a couple of new variables lists of strings and these are going to be the variables that are going to hold the data that comes back from the form right after the user puts their checks the boxes for which ones they want the form is going to compile those into two separate lists of components and parameters and send those lists back to the ilogic rule and store them in these parameters here these variables here so that we need to set those up ahead of time and now we've got those set up then we're going to actually load up the form and we're going to use this using block which is a good way to interact with the form uh and the way that works is you essentially dim up a new object we're calling it input form and we're dimming it as this is the type of object right here and how you know what to put here is going to be this is going to be the namespace of what you're trying to get inside of this from this reference dll and that's what comes from over here in our project properties this name space right there so if you're not sure what to put there come over to your visuals your project look at the what the name space is and that's what you're going to put right here then once you specify the namespace then you do dot and then we have to specify the actual class that we want to access in this case copy parameters form and again that's going to come from over here in our form code that's going to be this name of this class right there so if you're not sure what to put there come here and look at the what the class is called and that's what we're gonna put here okay so namespace.class that's the type of object we're creating so that lets it inventor know we are dimming up a class an object that represents that form an instance of that form okay so now that we've got that initialized then we have to send the before we actually load up the form we have to send it the input values the input lists so that's what's happening here so we've got our components list that's the list that we created up here we dimmed up this components list looped through and built a list of all the components in the assembly we are right here we are sending that into the input form and then we're accessing the property on that form that we've named components list so if i go over to visual studio that's what we named this property right here right so this is the property we set up to take the incoming list let's take the input from ilogic so if you're not sure what to put there we want to look at what the property we've named components list so let's input form dot components list and then we're going to set it equal to the components list that we built up here i maybe should have named these slightly differently so you could tell like this is not the same object as this they're two separate objects but we are setting them equal right here so that essentially sends those component lists and parameter lists to the form um the other thing we want to do is we want to make a link to [Music] the output lists so that when the form gives us the output we have access to it and so that's what this next section is doing here very similar to the first we're just linking up the parameter on the form called component names or excuse me the property on the form called component names so that right there so component names and parameter names those are the two properties we set up here to act as the the bin that the output is going to end up in so we set that equal to this variable that we set up right here so when the form takes the user input builds that list it's going to end up in stored in that variable right there same with the parameter names right there we write that to that property or we we make them equal so we're basically sending a reference to that variable to the form so we can fill it out and then when it fills it out it automatically fills out uh this reference variable here okay so we've sent it all the objects we need to send it to get started now we actually want to show that the have the form pop up and prompt the user for input so that's what this line of code is doing we're taking our input form and we're running the show dialog method that actually causes that form to pop up and when that happens you'll see it says function form.show dialog as dialog result so what we get back when we run that function is a dialog result which is a special kind of object that visual basic uses to let us know essentially we're using it to let us know which button the user picked right and it comes back as an enum which is just a type of uh so it's like a type of constant and it can have different values so we we dim up this special form result as a dialog result enum so that we can get that information back from this function when we run the form and the user finishes running it it's going to send us back this result but that comes back as an enum where our dialog results appear we've dimmed it as a boolean we just want to know if it was okay or not so this little statement right here is going to just convert that enum into a boolean so basically if the form result comes back as vbok that's one of the options you can use as one of the values that dialog result can come back has if it's come back comes back as vb okay then we just set our dialog result to true otherwise it just stays false so that lets us know if the user hit the ok button or the copy parameters button then it'll set this dialog result to true so then we know after we leave this using function what's going to happen is you know the user has put their input into the form they've hit one of the buttons once that's done it's going to end this using function it's going to discard this object so we the form closes and we lose the object and any reference to any of the properties and values that i had stored in it and so we need to be there's there's several things we need to get out of that that we don't want to lose after it gets discarded so one of those is what happened to the user click ok or cancel that's why we have this that's why we defined this variable here so we could know outside of this using block what's happened and that's also why we dimension these component names list and parameter names list outside of that using block as well so once this using block is finished and this object gets discarded we still have access to the values that were stored there okay um hopefully that makes sense it's it's kind of abstract and i'm doing my best to communicate exactly how this works but we'll get to some questions at the end in case any of this was not clear okay so at this point when that when we run the show dialog line of code the ilogic rule is going to pause at this point it's going to pop up the form and wait for the user to finish doing their input on the form and it won't resume until that form gets closed either by them hitting the ok button or the copy parameters button or they hit the cancel button or they hit the x in the upper right corner any of those options is going to close the dialog and give us a result to let us know what happened only at that point will this code the ilogic rule itself resume from this point so all right so once we've gone and got the user input the user has closed the form then we check okay if the dialog result was not okay you know if this is not true then basically that tells us the user canceled the process they don't want to continue with the copy operation so we just bail out we exit our ilogic rule here and don't continue otherwise if it was true then it continues on and um we would actually do the have a lot of code here that actually does the copy parameter part but uh here we like i said we've just got some message text that help lets us know what input we got back from the form so let's take a look at that we're going to go ahead and run it and see what we get back so let's go ahead and select both of our components here check a handful of these parameters and then uh let's hit copy and this is that just compiled message box code that's at the end of the rule lets us know okay these are the options that were selected from the form and if we want to do let's just maybe do one of these and then just a couple of those hit copy okay so this lets us know we're actually getting the right user input back from our external form back into our ilogic rule so we can continue to do real stuff with it okay so i think um that's all i had there let me just switch over and talk a little bit about some of the recent solutions that i have personally been working on here on the the automation team at kativ is many of the projects i've recently been working on involve creating a custom form like what we've been seeing here either something as simple as what we saw there or it could be quite a bit more complex i mean the sky's kind of the limit with what you can build with windows forms and we take the user input from those forms and we write a whole bunch of code in the background that says what to do with that input to convert it into an actual model inside of inventor and we can do anything from simplified sales models up to fully detailed manner manufacturing models and anything in between also another recent project that i've been working on that was really interesting is uh take building custom builds of materials that where we've got various sources of information either we've got inventor models that have data inside of them we've got uh excel documents even output from autocad we can take data from all those various different sources and compile them into a custom bill of materials that was laid out in a very specific way that you might you know maybe have a specific set of information that you want to send off to your customer to explain you know what they're getting with their order or you might need to send off a purchasing list to your purchasing department let them know what to buy for this project so that you can build your model and then along those same lines i've also been recently working on a project that's really interesting where we are automating some project documents in word um like for example a submittal document or a proposal document to your customer we've got all this information inside of our inventor models when we build them it's it's almost a shame when we go to actually document some of that stuff that we just have to manually type out all the same information that's already stored in our inventor model and so we've developed a solution where we can extract the data from the model export it and then export it from inventor and use that information to drive an automated proposal document yes there's a lot of exciting applications there so i just wanted to bring that up to let you know some of gt's capabilities if any of this stuff sounds exciting to you if it's something you're interested in please reach out to us let us know we can definitely build solutions for you or we can even help you if you're adventurous and want to try and take some of this stuff on yourself we can also we also offer training and mentoring on how to do this stuff so all right nigel should we get to some questions yeah let's just hop straight into questions first and foremost two before we jump into those questions jessica just dropped a link into the chat as well with a really awesome automation starter kit essentially it's our automation diy kit just brought up in the chat so go ahead and click that link essentially you fill out the form and then you get some really cool documentation back to help you get started with this process i know it is sometimes a very overwhelming undertaking to start automating stuff it's just completely different right it is it's i mean there's so much you can do there's there's so much power here but there's yeah there's so much to learn and i would recommend if you're going to do something like what we showed today if you want to build a an external form and bring it into eye logic i would say if you've never done anything like that before start simple like just start with the most basic form with just one or two inputs that you can drive and make sure you're understanding the process of linking up an ilogic form too exactly and that's the cool thing with automation is you don't have to automate the entire process and it doesn't all happen to have to happen at once um you can automate you know say for example you wanted to write certain parameters to your models and you wanted that to automatically happen based on certain inputs you could start your templates out with the form right and then just have that write out whatever parameters you wanted for this particular model and boom you've already taken care of some of the manual effort that a user would have to do on the back end and you just you know you keep doing that over and over again um five percent five percent five percent and ultimately you get to a point where like hey i've got seventy percent of my process automated uh yeah but i do these small chunks yep that's the right way to start yep so let's go ahead and jump into some of these questions um so first is from henrik is it possible to use vba and not use visual studio um i don't know if vba has a form i'm not sure i've only seen it with visual studio just that's my experience yeah i don't have a lot of experience with vpa um other than just scripting in it but as far as like building a form uh i mean i suppose if you have access to [Music] the api to build a form i don't know it doesn't have like a like a toolbox to help you easily create forms if you were trying to do that all through code i wouldn't even try unless i'm just not aware maybe it does have something like that but maybe it does i've only ever seen it using the method that you have so yeah um another question from jared will this be available to review after the webinar ends um yes it'll probably take about a week for this to hop on our youtube channel so that's youtube.com contive technologies you can go ahead and review it there um alternatively you could reach out to anyone here at cative if you need asap and we might be able to get you the recording earlier yeah i went through a lot of that code really quickly because i wanted to just highlight the the most important point of concept for linking up the external form but yeah if you want to go back to it once this is supposed to youtube you can go back to the video and then maybe just pause and look a little more detail of exactly all the code that's there yep uh question from jeff is the dot net version important when building custom forms for inventor i believe it is it is um i mean you do want to make sure that you're using a version of net that's compatible with inventor inventor is usually pretty good about staying up to date with recent versions of net if you're in doubt you can check the autodesk website they've got some knowledge network articles on uh what versions of dotnet are compatible with which versions of inventor um i mean if all of us fails you could use an older version like you you maybe have seen when i was pulling up the properties for my project that i was using.net 4.5 which is you know several versions back it doesn't hurt to do that as long as the that version of.net has the functionality you need then it's it's safe to maybe use a slightly older version just just for compatibility's sake 100 uh another question is it possible to get the code um so this is a question we get every time we do a webinar um some stuff we can share some stuff we can't uh so your best bet would be to go ahead and reach out to your either your account representative here at khatib or someone on the marketing team here in the kitiv and ask for what you need and we'll see what we can get uh is there an explicit function in the form that sends the output from the form back into the ilogic rule or does the form write the output values back to the ilogic rule automatically because it is a quote-unquote shared object yeah there is not an explicit function to do that i mean the windows form inside a visual studio basically has no idea that the ilogic rule exists it doesn't know what's running it so there's no explicit function to send the values back essentially what we're doing is we're using a variable we're sending it if you're familiar with like sending variables and functions inside of code you can either send them by value or by reference we're essentially sending the list variable by reference so that when the form code writes values into that variable it's essentially that variable is shared it's it's available to both the uh custom form code and the ilogic rule code and so when the form writes to it the iological can see those same results so that's how we're getting that to work that's how we're getting those values back cool let's jump into the next one do i need visual studio 2017 installed when using inventor 2021 or can i use visual studio 2019 uh 2019 works just fine that's what i'm using um and i i use 2019 for uh inventor 2019 2020 21. um i've even used it for autocad 2017. so um there's usually not a compatibility issue there but if you're if you're skeptical about that or you want to be sure i think there is again some knowledge network articles on autodesk about uh or maybe even searching the customization forums on autodesk to see if there's any compatibility issues with different versions of visual studio so i mean as long as you're using the right interop assemblies and uh the right version of net a compatible version of dotnet then you shouldn't run into any issues yep and then daniel ramirez got a great question here what do you recommend on how to divide an automation project for a simple design so i guess determining how to split up your project if you don't want to take it all in one big chunk which i think is the best way to do it that's a good question i think you have to look at it this way is you have to look at what you're trying to accomplish and see if there's ways where you can break it down that makes sense for example if you're doing some sort of big industrial machinery what i've seen before is is these things like on skids for example these skid-based designs um people will automate like the skid creation first and then they'll still do their like manual modeling of whatever goes on that skid to get to the point where ultimately they're going to add that portion as well so if you can break your model down into a couple of pieces and start the automation on a few of those pieces and still manually do the rest of it with the intention of ultimately automating all of it that's one way of doing it also i wouldn't suggest doing the drawing automation first by no means that's like probably the most complex part yeah i would save that for the end for sure once there's a lot that goes into that and it's it's easy to take trying automation too far like there's there's a lot you can do with it but at some point you hit a you know the point of diminishing returns where you're putting a lot literally gonna say the same word diminishing returns you're gonna put a ton of effort in it's really not gonna save you that much time on the back end or maybe it's gonna be more time in the front end than you save on the back and yeah i mean it's definitely worth doing some automation in your drawings but you have to be wary of the point of taking it too far yeah like every annotation every bubble every balloon um yeah just uh be careful you it you the good thing is you have all of this freedom the bad thing is you have all of this freedom so exactly uh but daniel if you all want any uh you know if you want our opinions on that um with your particular models or your assemblies uh or whatever you're building go ahead and reach out to somebody here on the team and we'll see if we can get like a little uh conversation going with one of our automation architects and see if you know we can help you build a game plan for that can you do the same i guess like the same concept that you did today if the form is in an add-in um i mean yeah you can definitely pull a form into an ad and we do that all the time i would say that's probably the most common workflow that we use when in our automation projects but there's not really if you're using an add-in uh you maybe don't necessarily need to have eye logic involved in actually launching the form so um but i mean even if you do have eye logic you can you can do exactly what we did if you're doing stuff with an add-in um although i guess as long as you've got access to that dll which would be compiled as part of your add-in then yeah you can still do the same thing you just might if you're doing an adding anyway you might just take a different approach anyway right and then this question is a two-parter do you have content in the spanish language and do you have any content on forge so we don't actually publish any content in spanish but we do have multiple instructors on our team that are fluent spanish speakers um so we do offer training and mentoring in spanish if that's something that you require um in terms of forge it's really hard to do content on something that's so uh i guess freedom enabling you can do so much and forge it's really hard to like narrow it down to one thing uh so that would be one of those things but uh if you have any questions about spanish language information reach out to somebody here on the team and we'll see what we can do for you all right can you do basic forms in vba i mean you can make them as basic as you really want to right well that's that was a similar question to one that was asked earlier i i'm not familiar with any form capabilities inside of you that's one of those things where i need to talk to ep i'm pretty sure if if they have it i wouldn't be surprised it was more limited than what's in visual studio and i would just i would just run everything for visual studio honestly um once you get used to the interface and stuff um just do everything in there right don't have to bring in another thing especially if you plan on like adding more stuff later um in terms of like automation capabilities almost all of it's going to get done in visual studio anyway so you might as well start there yeah i mean if vba has the ability to create forms i would say yeah you can absolutely do what we just did here um you just need to if you need to link it up to ilogic you're gonna have to have that dll so if if vba can export that dll for you can compile that code as a dll then ilogic can get access to it and then uh louis sanchez can you use forms to modify parts and assemblies directly absolutely uh can you say that again yeah can you use forms to modify parts and assemblies directly i mean if you set it up that way yeah yeah i mean with code yeah you'd have to write the code to tell it to do that but i mean that's the kind of stuff we do regularly so yeah the answer to that is yes and all you have to have is like the intelligence behind the code to understand what changes um based on the input you put in right and that's like the whole part of automation right is if you have the information on how the product gets built and what parameters like and the logic behind how the parameters are linked to each other and how they affect each other when they change um ultimately that's that's what automation's all about is to speed up that process so that you could just do it and not actually do it yeah well and that's that's exactly what uh the built-in ilogic forms do if you build a form inside of an assembly or a part and you put uh controls for the parameters and properties in there you're directly modifying if the user launches that form inside of a part or or an assembly and types in a value for a parameter you're directly modifying it that's what the outlook forms that's how they work so if that's what you need definitely look into setting up how the built-in ilogic form functionality works and we've done ava's on that recently yep back in and in fact i did one on that it was last year oh my god i mean it's the beginning of the year so it's not that long ago cameron yeah so yeah go check that out um i mean like i said at the beginning our logic forms are powerful and i've done you can do a lot of stuff with those it's only if you and that what i would i would say would be the starting point if you need some user input start with an alleged form see if you can do what you need to do with that but it when you get to the point where you need something a little bit more that's when you start looking at building these external forms yep makes a lot of sense and then we've got a great question from michael that came from youtube and he's asking if it's possible to create web-based models from a simplified model um and then he says he'd like to bring up a simplified inventor model to a web-based front end drive the model through a question and answer form um and make it like an interactive viewer so absolutely that's something that a lot of people do from like the quoting end uh to be able to make their coding more powerful right is if a customer comes in and says hey i want to look at your custom furniture for example i'm going to input the dimensions that i want based on like it's like we'll use the same analogy that i use all the time is you go to like an automotive manufacturer's website and you like build your car right you pick the color you pick all the options and then it shows you a preview of what that looks like um it's essentially the same concept can be done with cad models um is if a user on a web-based front end can go ahead and input the parameters they want for their product whether that be furniture cars pumps whatever you can have that connect to an inventor model that's updating and giving that person a preview so that's definitely very possible um let us know if that's something you're interested in it's stuff that we've worked on for other people in the past i think that's it for questions right now i don't want to go over the hour mark but cam i'd like to thank you for joining us this morning i guess it's almost afternoon for you um and putting the session on for us yeah absolutely great to be here absolutely thanks everybody for joining us if we didn't get to your question um it's likely because it's kind of super specific to something maybe you're doing specifically but reach out to any of us here at the catie team whether that be your account representative or the marketing team who sends you these emails to remind you of these webinars and if you want to have a deeper conversation about you know what you're going through or what your plans are let us know we're more than happy to field those so uh thanks everybody for joining today cam you have a great rest of your day all right thanks cool take it easy everybody
Info
Channel: KETIV Technologies
Views: 1,659
Rating: undefined out of 5
Keywords: ilogic, autodesk, autodesk inventor, inventor ilogic, autodesk ilogic, ava academy, autodesk academy, ketiv academy, autodesk virtual academy, inventor api, help with ilogic, autodesk software, inventor 2017 professional, autodesk inventor 2018, rules driven design, inventor automation, ilogic forms, autodesk inventor tutorial for beginners, autodesk inventor 2020, autodesk inventor tutorial, inventor ilogic tutorial, inventor ilogic rules, Ilogic inventor
Id: 6JG08eRDRHk
Channel Id: undefined
Length: 58min 1sec (3481 seconds)
Published: Wed Mar 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.