iLogic technology that is now included with Autodesk Inventor is insanely easy to use given the power that is right inside of the application. Having said that - I'm convinced that demonstrating iLogic functionality is as difficult to demonstrate as anything I've ever done. Now let me explain before my colleagues start throwing things at me - like I said, the technology is insanely easy to use, what is difficult is providing an example of what is possible without people thinking "oh, it's a configurator", or "oh, it's a standards managing tool", or "oh, it's a geometry creation tool"... Here's the thing - it can be all of those things and more.
So how do I get the word out about what it can do? I figured the best way was to just start pushing out example after example of what it can do, give you guys the sample code and see what you can do with it. Yesterday I put out the first video in this series and decided to go with something that was crazy simple - prompting users for iProperties. Have a look at the video:
So as you can see, it's crazy easy to setup these rules and associate them with events. Now what isn't included in the video is the step that one would take to save this off as a template file. This would be required in order to have the user prompted right away for Title and Part Number each time a new part file is created. The video was starting to run long so that was cut out.
Click Download Title_PN_Voice_Code to download the iLogicVB files that I used for this example, or you can copy / paste from the sample code below.
Title Example:
Title = iProperties.Value("Summary", "Title")
If Title = "" Then
Title = InputBox("Please Enter the iProperty Title", "iProperties Check - Title Filled Out?", Description)
iProperties.Value("Summary", "Title") = Title
End If
Part Number Example:
PartNumber = iProperties.Value("Project", "Part Number")
If PartNumber = "" Or PartNumber = ThisDoc.FileName'(False) 'without extension
PartNumber = InputBox("Please Enter the iProperty Part Numbver", "iProperties Check - Part Number", PartNumber)
iProperties.Value("Project", "Part Number")= PartNumber
End If
Bonus "Voice" Example (I can't believe this actually works...):
PartNumber = iProperties.Value("Project", "Part Number")
Description = iProperties.Value("Project", "Description")
Project = iProperties.Value("Project", "Project")
If PartNumber = "" Or Description = "" Or Project = "" Then
'___Use windows voice command____________
Dim objSPVoice,colVoices
objSPVoice = CreateObject("SAPI.SpVoice")
objSPVoice.Speak ("make money money, make money money")
End If
I'm interested in your feedback on the format, download deliverable, and the general example. Please send along "can I do this with iLogic" questions and we'll get to work on the example for you. This is incredible functionality that is included with Inventor; functionality that is usually an extra $$$ add-on... so let's take advantage of it.
-Rob
P.S. - Going to upload the mp4, just in case you can't see it on YouTube. Download the video here: Download ILogic1Final
Thanks for your great tip!
Can I get Inventor to add "mass" & save date" information always on save to custom field, so that i can insert that field on drawing?
Posted by: Samu Wihlman | 06/09/2010 at 10:14 AM
You can also format the text from the input box:
PartNumber = Trim(Ucase(InputBox("Please Enter the iProperty Part Numbver", "iProperties Check - Part Number", PartNumber)))
Add a trim and ucase proceeding the inputbox to trim out extra spaces and make it upper case.
Posted by: Thomas Rambach | 06/10/2010 at 06:15 AM
Thanks for the video! Great to see more useful iLogic ideas starting to come out. Rob, I want to make a popup dialog box that gives you the option to enter a number of iProperty values eg.Part Number, Description, Project all in one go. Would you suggest I try and extend something like your snippet to work with multiple values at once or go back to vb macros and do it the old way? I see there is a wizard in iLogic that takes in a DLL file. I assume this is to use rules to fill out dialogs that are part of separate add-ins? Bit confused as to when to use what....
Posted by: Gavin Bath | 06/10/2010 at 04:51 PM
Just found your Youtube vids and blog this weekend.
I can get the ilogic to work within the file (Money, Money). But when I save out and start a new file the rules arent active in the file. I restarted Inv just to see if thats when the new rules go active and no luck (I want my 2 dollars).
Posted by: John the Unemployed | 06/13/2010 at 11:31 PM
If you want the rules to be in any new file you create John, you'll need to open the template file, create (or copy in) the rules and then save it. Then when you create a new file using that template the rules will be in it. If it's just a problem of the rules not running, you can create rule triggers that determine when they run.
Posted by: Gavin Bath | 06/15/2010 at 02:33 PM
Was that THE Seth Hindman? I wonder what Seth has written on the post-it notes on his wrist-rest? Probably something like;
1.) Don't forget the grade-school career day... convince kids that machinists are KEWL!
2.) Engage people on the public bus in discussions about topology and the equations behind KFactor Based unfolding methods. (Live the dream)
3.) Develop the Sheet Metal module to complete the Master Plan to rule the world.
4.) Work on evil laughter... it's all in the diaphram.
5.) Think of snappy comebacks for that smart*** Cohee.
Posted by: jdavis417 | 06/15/2010 at 08:45 PM
What I really want for Christmas is a web-driven application that allows our Reps to enter product series, sizes and quantities (and other, known design requirements) and get back a "real-time" quote and a nifty 3D model for their use. Said models would then be passed along to Estimating, Engineering, Shop Drawings and Factory Order groups for scheduling and production porpoises (no, I'm not a Dolphins fan).
If you will walk me through how to accomplish this lofty goal with iLogic, I'll give you a nice stick of gum to split among yourselves!
Posted by: jdavis417 | 06/15/2010 at 08:56 PM
For adding rules to templates what is the best practice External or In Document, I note as previous comment that you have to have the external rules loaded (RunExternalRule: Cannot find an external rule file named: "Material")to get them to work each time so isn’t it better to permanently add them In Document?
Posted by: Rob Beckley | 06/17/2010 at 02:19 AM
Just in time for Christmas 417. I will be presenting a class at AU named "iLogic - Outside The Box: External Rules Management". Among other things it will cover....wait for it....Web driven iLogic! Not exactly sure how I'm going to code that just yet but Cohee tells me I'm good at making stuff up as I go.
Posted by: Tim Strandberg | 06/27/2010 at 06:12 PM