Revit -Add in exception handling

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a semi-complicated Revit add-in which imports a simple text based file type. If the data in the file is incorrect it throws a nullreferenceexception, which I have wrapped in a try/catch block, this happens inside of a method and outside of a transaction. I've made it return a failed result and an error message to the user.
The problem is that the Add-in wont launch again after this, nothing happens when its clicked.
In another part of the Add-in program I have a WPF form which I use close() and dispose() on and I need something similar for this if anyone could send me some methods or guidance on best practice I could possibly investigate?
What do I need to call to "reset" the Add-in back to its original state?
I've searched through the building coders articles for an answer to this with no resolution so far.
Thanks all!