Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

close revit with code vb.net

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
marcosmateo
434 Views, 3 Replies

close revit with code vb.net

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

3 REPLIES 3
Message 2 of 4
arnostlobel
in reply to: marcosmateo

Marcosmateo:

 

you cannot close Revit via the API. Only the end user can close it.

Arnošt Löbel
Message 3 of 4
sanjaymann
in reply to: marcosmateo

 

Yes. You can do it using the following code.

 

Process[] ItemProcess = Process.GetProcessesByName("Revit");


if ((ItemProcess != null))
{

     foreach (Process SubProcess in ItemProcess)
       {
        SubProcess.Kill();

        }
}

Message 4 of 4
arnostlobel
in reply to: sanjaymann

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.

Arnošt Löbel

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community