Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Ignore error messages with iLogic

Daan_M
Collaborator

Ignore error messages with iLogic

Daan_M
Collaborator
Collaborator

Hello, 

 

I've made a configurator in Inventor using iLogic and C#, Inventor imports variables for a Excelfile. I use iLogicautomation to trigger my iLogic code. This runs on a server so basically theres no users involved in this.

 

Sometimes the wrong data is put into the Excelfile, which makes the Inventor model pop up with a message "iPart member x is not found in ....", so it doesnt create a model. The problem is that the model is now stuck and i cant continue without closing the error message first, even if the next input from Excel is correct data.

 

Since this is running on a server i dont want to have to open a remote desktop and press 'ok' on the error message everytime a wrong input is given. Is there a way i can ignore this error so the model keeps running and simply waits for the next correct input?

 

Thanks

Reply
Accepted solutions (1)
2,874 Views
2 Replies
Replies (2)

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Daan_M 

I think you can solve your problem with a simple Try-block in your iLogic rule.

For example, this code would return an errormessage:

MsgBox(ThisDoc.Document)

This however would not:

Try
MsgBox(ThisDoc.Document)
Catch
'There's an error, do something here or maybe just exit the sub?
'Exit Sub
End Try

Also this would not. The difference here is that if any line gives an error, the code will just move along to the next line:

On Error Resume Next
MsgBox(ThisDoc.Document)
MsgBox("hello")

The first msgbox will fail, but the second one will still be displayed.

 

Hope this helps 🙂

Daan_M
Collaborator
Collaborator

Thank you, i will try to implement your solution to see if it works!

 

Edit; The catch block worked fine, cheers!

 

0 Likes