Use iLogic to create local iLogic rule (but not run it), or edit an existing one
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using the code in the following blog post to have an external iLogic rule create a local iLogic rule in my document: AUTODESK INVENTOR – ILOGIC – CREATE A NEW ILOGIC RULE AUTOMATICALLY.
Problem is, the "AddRule"command used to do this also runs the local rule after creating it. But I don't want to run the rule yet, I just want it to be created. If it runs when the external rule creates it, a whole bunch of things will go wrong.
Indeed, if I open C:\Program Files\Autodesk\Inventor 2017\Bin\Autodesk.iLogic.Interfaces.xml, under the remarks for the "AddRule" command command it states that "The rule will be compiled and run." So this is how the command is supposed to behave.
But is there any way to disable or circumvent that behavior? Maybe a way to suppress any iLogic rules from running until after AddRule has finished, and then un-suppress? (I tried using the "EnterDelayedRuleRunningMode" command to do just that but it doesn't make any difference.
Any suggestions on how to create a local iLogic rule without immediately running it?
Another possibility would be to have my external rule create the local rule empty, and then have my external rule edit it to have the correct contents. But I don't know of a command to edit an existing local rule. I'd like to be able to do that anyway, so if anyone knows of a way to do that, that would be great.