Hello all,
I am getting following message (crash) while opening and closing multiple Revit families.
I have gone through the following link related to above error message, but we are unable to narrow it down to the exact problem.
Below is our code snippet,
Autodesk.Revit.DB.Document doc = globalDoc.Application.OpenDocumentFile(filePath); try { //Some oeprations to get family types //and parameters and store them in xml } catch (Exception ex) { logDocument.Message(ex.Message, ex.StackTrace); } doc.Close(false); doc.Dispose();
Seeking advice/help on this issue. TIA.
Hello all,
I am getting following message (crash) while opening and closing multiple Revit families.
I have gone through the following link related to above error message, but we are unable to narrow it down to the exact problem.
Below is our code snippet,
Autodesk.Revit.DB.Document doc = globalDoc.Application.OpenDocumentFile(filePath); try { //Some oeprations to get family types //and parameters and store them in xml } catch (Exception ex) { logDocument.Message(ex.Message, ex.StackTrace); } doc.Close(false); doc.Dispose();
Seeking advice/help on this issue. TIA.
@Anonymous
Hey,
Every time i have gotten this error, i was able to pinpoint it by debugging.
They could be caused by an ungodly number of different things, but typically it is an unhandled exception somewhere.
My advice would be to attach a debugger to it and go line by line until it fails. The Output and Immediate windows in VS will help immensely.
Since you have a try/catch there, i would move the last two lines up inside the try block.
You should be able to glean more information if you haven't already tried that.
Thanks,
Matt
@Anonymous
Hey,
Every time i have gotten this error, i was able to pinpoint it by debugging.
They could be caused by an ungodly number of different things, but typically it is an unhandled exception somewhere.
My advice would be to attach a debugger to it and go line by line until it fails. The Output and Immediate windows in VS will help immensely.
Since you have a try/catch there, i would move the last two lines up inside the try block.
You should be able to glean more information if you haven't already tried that.
Thanks,
Matt
Hi:
Suppose that you try...catch block is inside an External Command class, isn't it?
Do you use any modeless window? Like winform.Show() or wpfWindow.Show() ?
Those try...catch... can never catch any exceptions that is caused during a modeless window lift cycle.
You should also pay attention to those window event handler, such as ......_Click(sender, e), ..._KeyUp(sender, e), etc.
As far as the experience of our team, there are 3 main points to which you must pay attention to the protential exceptions:
Mostly our addin crashes from modeless window handlers.
And, the above mentioned are all based on our EXPERIENCE. 🙂
Besides:
Have you noticed the following infomation from Revit API Help Document
Hi:
Suppose that you try...catch block is inside an External Command class, isn't it?
Do you use any modeless window? Like winform.Show() or wpfWindow.Show() ?
Those try...catch... can never catch any exceptions that is caused during a modeless window lift cycle.
You should also pay attention to those window event handler, such as ......_Click(sender, e), ..._KeyUp(sender, e), etc.
As far as the experience of our team, there are 3 main points to which you must pay attention to the protential exceptions:
Mostly our addin crashes from modeless window handlers.
And, the above mentioned are all based on our EXPERIENCE. 🙂
Besides:
Have you noticed the following infomation from Revit API Help Document
Can't find what you're looking for? Ask the community or share your knowledge.