iLogic rule running order and delay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
~ Solved before I even hit post, in a last ditch effort I checked one more thread~
It appears that using the iLogicVb.Automation.RunRule allows the prior rule to finish before moving on, simply adding this to the end of my code that generates the drawing from the assembly worked instantly (once I removed all of the messy debug steps)
Why am I posting this regardless? I searched for days trying to find a solution, and nothing matched the issue I was having, be it caused by my terrible coding or poor knowledge, I don't want some other unlucky soul to face the same issue.
Hi,
I've been tackling a problem in my iLogic sequence for several weeks now to no avail...
I have a set of rules that from start to finish create an assembly and create a drawing from the assembly with dimensions etc.
I have a rule in my assembly that creates the drawing and places views, then, in my drawing I have a rule to add dimensions to the views.
The problem comes when trying to automatically run the drawing rule, if I use the "on new document" iTrigger, it runs the rule but doesn't wait until the assembly rule that places the views finishes, instead it will error out as no views exist yet. Once the error is handled, the dimension rule exits, which then allows the assembly rule to exit at which point inventor places the views on the sheet.
Currently, my workaround is to show a form (which I would need to show anyway) using the "on new document" iTrigger in the drawing. The form is shown, the rule exits and then the assembly rule exits and all is well, but this leaves the user to manually run the dimension rule. It works, the user is "tricked" into waiting a second or two before running the rule but I'd like a more permanent solution.
Other things I have tried
- Adding a sleep to the dimension rule - all this does it wait while the assembly rule is paused in the background, after the sleep it runs but because the assembly rule hasn't finished it errors out
- Using the assembly rule to call an external rule - the external rule cannot run any of the drawing rules and it is called before the assembly rule is finished, so the new drawing isn't loaded yet
It seems like my main issue is that I can't exit the drawing creation rule before running other rules in the newly created drawing, or that there is no trigger to wait until the views are present and the rule is finished before automatically running another rule.