title: How to silently send a synchronous Lisp command to Autocad from c# code?
body: <p>I am trying to silently send a synchronous Lisp command to autocad from c# code.</p>
  <p>Here's how we send a Synchronous command to autocad.</p>
  <pre><code>string textToSend = $&quot;(command-s \&quot;_.-layout\&quot; \&quot;_t\&quot; {filePath} {layoutName})&quot;;
  object acadDoc = Application.DocumentManager.MdiActiveDocument.GetAcadDocument();
  acadDoc.GetType().InvokeMember(&quot;SendCommand&quot;, BindingFlags.InvokeMethod, null, acadDoc, new[] { textToSend + &quot;\n&quot; });
  </code></pre>
  <p>The command works but the problem is that the command ends up in autocad's command line and clogs up the history of the drafters using our extensions.</p>
  <p>We tried modifying system variables CMDECHO, CMDDIA, and NOMUTT without success</p>
  <ul>
  <li>Directly in autocad's command line manually</li>
  <li>With the c# method SetSystemVariable()</li>
  <li>The same way we called our InvokeMember(&quot;SendCommand&quot;)</li>
  <li>In the same Lisp command where we do our action</li>
  </ul>
  <p>I looked at the InvokeMember parameters but didn't see anything that might affect the display of the command like there exists for the ActiveDocument.SendTextToExecute() asynchronous command.</p>
  <p><strong>How do we send synchronous Lisp commands to autocad from c# code silently?</strong></p>
  <p><em>Ps: The reason why I am not using WBlockCloneObjects() is because it makes our apps extremely unstable. I am not really interested in opening that whole can of worms in this issue, I'm only stating this to explain why I ended up with the solution from my question.</em></p>