How to Skip error messages

How to Skip error messages

Anonymous
Not applicable
1,536 Views
2 Replies
Message 1 of 3

How to Skip error messages

Anonymous
Not applicable

I am receiving an error message when running a rule:

 

Error in rule: 

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

 

Long story short, this isn't really an error and the rule is running correctly. Is there a command to add to my rule code to not display this error message? I cannot just use something like "on error resume next" because I need this error to occur but I do not want to see the message. Any way to just not display the error message box? Or even to automatically click ok when this error message box appears?

 

0 Likes
Accepted solutions (2)
1,537 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

There are a few ways to 'handle' errors, such as using the Try...Catch...End Try block of code around it, or as you mentioned the older method of using 'On Error Resume Next', but if those aren't what you are looking for, there is still another option specifically for this type of situation.  It is a Property of the Inventor Application called 'SilentOperation'.  It has a Boolean (True/False) type of Value.  You can set that to True to avoid dialogs & error messages, then always be sure to set it back to False, when done.  But beware, if your code errors out before it gets to setting it back to False, you may have to set it back using a different rule.

To use it just use this line:

ThisApplication.SilentOperation = True

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3

Anonymous
Not applicable
Accepted solution

I actually ended up trying your try catch approach.... worked like a charm! Thank you!

0 Likes