Send Command by C#

I want to call and run my command with arguments through C# can anyone help me out in this?
i have tried:
Document doc1 = _AcAp.Application.DocumentManager.MdiActiveDocument;
doc1.SendStringToExecute("MyCommand", false, false, true);
also:
doc1.SendCommand("MyCommand");

but it didn't worked.

TIA.

Comments

  • You might try with an added enter/return (as NewLine character) appended to "MyCommand" :
    "MyCommand\n"
    that mimics the return/enter on commandline ... next input then should be the arguments as requested :
    "MyCommand\nArg1\nArg2\n.....\n")

    does it help ?
    many greetings !
  • yes it works!!
    thank you so much!!!
    Torsten Moses.