Valued Contributor
Posts: 68
Registered: ‎07-25-2012
Message 1 of 3 (707 Views)

VB.NET Code to Close AutoCAD

707 Views, 2 Replies
07-31-2012 08:12 AM

I am having some difficulty in finding information on how to close AutoCAD from my VB.NET code. I open it, create a drawing, save and close the drawing, and now I need to close AutoCAD.


I'm using VB 2010 Express and here is the code which launches AutoCAD.


        Dim vAcadApp As AutoCAD.AcadApplication
        Dim vAcadDoc As AutoCAD.AcadDocument
        vAcadApp = New AutoCAD.AcadApplication
        vAcadApp.Visible = True

 After the drawing is closed I need some way of closing down AutoCAD.

*Expert Elite*
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 3 (701 Views)

Re: VB.NET Code to Close AutoCAD

07-31-2012 08:57 AM in reply to: btillman

Have you tried





Valued Contributor
Posts: 68
Registered: ‎07-25-2012
Message 3 of 3 (695 Views)

Re: VB.NET Code to Close AutoCAD

07-31-2012 10:26 AM in reply to: Hallex



Thank you for your reply. That worked, but I think I must find another location to place it because the LISP program which prepares the drawing did not seem to finish before AutoCAD shutdown. Or at least when I opened it up the drawing was missing quite a few lines which would normally have been there.


I tried using System.Threading.Thread.Sleep(10000) and that seemed to have helped but one of the blocks which gets inserted is all out of scale. I will have to play around with this some more but many thanks for your reply.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.