简体   繁体   中英

running commands of autocad from c#

I'm working on an integration project that utilizes commands of AutoCAD. My goal is to execute the command in AutoCAD using c#. In my work this is what I use to open the app but when i perform the SendCommand() function to execute the command i want to execute, It just forwards the text in the command line of autocad waiting to be entered not automatically run after the sendcommand(). I was hoping that you can help me with this one. I'm still new in this kind of stuff. Help is very well appreciated.

Here is my code snippet:

acApp1 = new AcadApplication();
acApp1.Visible =true;
acApp1.WindowState = AcWindowState.acMin;
acApp1.ActiveDocument.SendCommand("_CYLINDER")

*cylinder is only an example command for the code. Thank you very much for the kind response.

我想你的问题可能是因为你需要[space]在命令的末尾

acApp1.ActiveDocument.SendCommand("_CYLINDER ") ; 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM