Hello everyone
I am developing an addin revit using vb.net 2012, I have a form with a button to "close revit". How I close revit pressing that button in my windows form?
regards
Solved! Go to Solution.
Solved by sanjaymann. Go to Solution.
Marcosmateo:
you cannot close Revit via the API. Only the end user can close it.
Yes. You can do it using the following code.
Process[] ItemProcess = Process.GetProcessesByName("Revit");
if ((ItemProcess != null))
{
foreach (Process SubProcess in ItemProcess)
{
SubProcess.Kill();
}
}
Yes, of course, but that killing will kill your very own external application as well. I'd also suspect (although never have tried) Revit may report problems during such exits or, even worse, lose unsaved work in modified documents. I cannot endorse such a solution for a commercial application.