Message 1 of 3
AutoCAD Open/Close Automated Process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm working on an automation process and have had some sucess with it. It's automated which means no user input is allowed. Basically the process does this:
1. Opens AutoCAD 2013
2. Loads a LISP program and executes it (a drawing is prepared and saved to the server)
3. Closes AutoCAD 2013 and waits fot the next drawing request
All works well with the exception of step #3. I haven't attempted this for the last few weeks but my testing back then to close AutoCAD caused it to close too soon. The LISP program did not complete it's execution before AutoCAD shutdown. I tried to do some delay in VB.NET but those attempts did not work as planned. The code I'm using is below:
Sub Launch_AutoCAD() Dim vAcadApp As AutoCAD.AcadApplication Dim vAcadDoc As AutoCAD.AcadDocument vAcadApp = New AutoCAD.AcadApplication vAcadApp.Visible = True vAcadApp.WindowState = AcWindowState.acMax vAcadDoc = vAcadApp.Documents.Open("\\a_long_novell_server_path\My_Automated_Template.dwg", True) vAcadDoc.SendCommand("(load ""//another_long_novell_server_path/my_lisp.lsp"" ""The load failed"") " & my_start_command & Chr(13)) End Sub