Mike,
This is useful code. Thanks for posting it. I have not been able to find out how to programmatically place a rule under a specific Event Trigger after it has been added to the document. For exampIe, I would like to add "MyRule" under the BeforeSaveDocument event trigger with VB. How is this done? Also, where can I find info on all iLogicAuto members? Thanks.
Rob
Rob and I may be asking for the same thing, but can this be used to add an external rule to every to the current file and added to a particular save event?
I am not too familiar with external rules so maybe I am going about this wrong but I am in the process of writing an iLogic Manager macro that will apply or remove rules from files. Mike's code adds the rule to the file but does not place it under an event trigger. We have thousands of pre-iLogic Inventor files that I would like to apply iLogic to without having to go in and manually add rules under event triggers. The event trigger rule placement is the last thing that I need to complete it.
Rob,
I think we'relooking for the same solution. I perfer the external rule as then there is a single file to edit, to update the rule universaly.
But I'd like to have it automatically added to the save event as well.
As far as I can tell you still have to set the event triggers for each file with an external rule(correct me if I am wrong here). Either way you have to deal with it at an internal per file level to some degree. I think I can deal with having internal rules on the files because I will be able to mass update, add or remove them to all files in a folder via the API. Come to think of it, iLogic would be a nice addition to the Task Manager options for doing this don't you think?
Is it even possible to locate a rule under an event trigger with the API? Does anyone know of or use a better method for applying iLogic to "old" files?
CPRob,
I see it's been a while since you've worked on this. Did you find a solution? I'm looking for the same thing. I've set up external rules to be triggered by save events in the templates. Any file created from the templates triggers the correct ilogic rules. But for any file created outside of our templates (such as content center files, frame generator, wire and harness, etc...), they don't have the rules in their event triggers. Did you find an easy way to get the rules automatically inserted into the event triggers? I don't even mind using a form to do it.
I've read http://inventortrenches.blogspot.com/2011/08/built-for-speed-running-ilogic-rules.html which attempts to do this using an add-in, but you can't assign the rules to any other event.
Hi jeff_jordan,
Here's another part of the puzzle to be aware of if you've not already seen it:
http://beinginventive.typepad.com/being-inventive/2011/10/creating-ilogic-rules-automatically.html
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Jeff, I did not find a solution to this. My solution ended up being adding the desired external rules under the event triggers manually. It took forever. I asked Mike Deck who is the iLogic expert at Autodesk if this could be done and he said no. I also asked Brian Ekins and he suggested that I try doing it with an Add-In instead. It seems simple to me to expose this functionality via the API. Adding the rule is useless if you cannot place it under an event trigger. I am sure there are many people like us who would like to add iLogic to their old files. A while back I looked into Jurgen's solution posted on the link you mentioned but it did not solve the issue as you described and appeared to be a rather complex workaround.
Thanks guys! I feel like Autodesk forgot about content center files, accelerators (frame generator, etc...), and legacy parts when they designed their system. I am using iLogic to enforce some iProperties that are later observed in Vault for property compliance. The iLogic rule itself was designed to REDUCE errors. Adding the rule manually INCREASES the risk of user error. Manually adding the rule defeats the whole purpose. I hope, like you, that Autodesk realizes the significance of this.
CPRob, it's amazing that a year later there is still no solution to this problem. I feel for you! But it's also telling as to how slow Autodesk reacts to issues like this.
Hoping for the best!
If anyone would like this functionality let Brian Ekins know - http://modthemachine.typepad.com/ At AU this year he mentioned that he is always looking for ideas for things to include in the next API release.
Just to get Jeff_Jordan up to date, I have worked on this problem some, and have a solution in the form of an application that I made in order to automate rule creation / event triggers.
More info can be found in this thread : http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/API-set-an-Event-Trigger-for-an-ilogic...
Note that the application also comes with source code if you want to do some messing around with the inner workings!
Hope that it helps you out some!