title: Calling LISP command from AutoCAD .NET Editor.CommandAsync
body: <p>I am attempting to call an inbuilt AutoCad Electrical LISP command <code>"c:wd_insym2"</code> from .NET.
  I have recently installed AutoCad 2016 which now has the Editor.Command and Editor.CommandAsync functions, however all the help/forum posts that I can find refer to using it to call AutoCad commands such as LINE, CIRCLE etc.
  I want to call a lisp command, such as:</p>
  
  <pre><code>(c:wd_insym2 "HPB11.dwg" (list 0 0) 1.0 nil)
  </code></pre>
  
  <p>which inserts a pushbutton symbol at <code>0, 0</code>.</p>
  
  <p>Here's what I've got (I have been using CommandAsync because I have had trouble sending that command synchronously using Application.Invoke before: <a href="https://stackoverflow.com/questions/32513029/autocad-command-rejected-undo-when-using-application-invoke">AutoCad Command Rejected &quot;Undo&quot; when using Application.Invoke()</a></p>
  
  <pre><code>&lt;CommandMethod("SendCmdAsync", CommandFlags.Modal)&gt;
  Async Sub SendCmdAsync()
      Dim doc As Document = DocumentManager.MdiActiveDocument
      Dim ed As Editor = doc.Editor
      Dim cmd As String = "(c:wd_insym2 " &amp; ControlChars.Quote &amp; "HPB11.dwg" &amp; ControlChars.Quote &amp; " (list 0 0) nil nil)"
      ed.WriteMessage(vbNewLine &amp; "Trying to execute: &lt;" &amp; cmd &amp; "&gt;" &amp; vbNewLine)
      Await ed.CommandAsync(cmd)
      ed.WriteMessage(vbNewLine &amp; "Done.")
  End Sub
  </code></pre>
  
  <p>When I run it it says 'LISP command not available'.</p>
  
  <p>Is what I'm doing possible, and if so, what am I doing wrong?</p>