TheSwamp
Code Red => .NET => Topic started by: leo_li on March 14, 2006, 09:10:13 PM
-
I "SendStringToExecute" a lisp program in c#.net. Now send the second lisp program in c#.net. Before I the second lisp want to stop the first lisp program just like press Esc key. Is it possible? Thanks a lot
-
I haven't used SendStringToExecute() mainly because of it's asynchronous nature.
-
You are right. It is a really big program. But I create a Dock Palette with C#.net. I add some buttons on it. I can load different lisp program by click each button. When I click one button, the lisp program will be running in the command. If you click another button at this time, the new lisp program won't be loaded because of the first lisp program is not finished. So when I click the second buuton, I want to stop the first lisp program before I load the second lisp program. Is it poosible in C#.net?
-
I think I understand you.
I assume the net assembly ONLY creates the Palette with the buttons, everything after that would follow the "normal" acad rules, so I cant think of a way to consistantly do what you want. Have you tried adding ^C^C to the command string in the Palette command.
-
^c^c doesn't work. I see some command seems useful.
AcadApp.DocumentManager.MdiActiveDocument.CommandCancelled...
AcadApp.DocumentManager.MdiActiveDocument.LispCancelled...
But I don't know how to use it. Could anyone tell me, are those command can be used in this case?
-
^c^c doesn't work. I see some command seems useful.
AcadApp.DocumentManager.MdiActiveDocument.CommandCancelled...
AcadApp.DocumentManager.MdiActiveDocument.LispCancelled...
But I don't know how to use it. Could anyone tell me, are those command can be used in this case?
You can not call theese functions - it is a reactors function which called by AutoCAD if command canceled or lisp-function canceled.
IMHO, thay can not help you. :(
I've not tested but you can try call finction acedCommandCancelled():
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl)]
extern static public acedCommandCancelled();
Another way is using Autodesk.AutoCAD.Interop.IAcadDocument.SendCommand(System.String Command);
This call is synchronous!
You need add to your project reference to AutoCAD COM library.