Close current document using local rule without producing error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a Part file with a local iLogic rule which does "some stuff" to configure Inventor. After the rule is done, I want it to close the part document that it's in. I have the following code at the end of my rule to do just that:
ThisDoc.Document.Close
This works just fine; the iLogic does everything I want, then fires this line and the document closes. However, immediately afterwards, I get the following error:
I'm about 99% certain this is because the rule isn't able to properly finish executing and hand off control back over to Inventor.
I'm able to continue just fine after that, Inventor doesn't crash or anything, but I want to avoid this error popping up.
So, is there some way to get around this? Just for kicks I tried adding an "On Error Resume Next" before the Close line, but it didn't make any difference.
Any suggestions? Or is it impossible to avoid this error?
(PS, the local rule does need to remain a local rule).