Hi,
In my AutoCAD .net application, I user COM interop to create some menu items. when I add the escape string "^C^C^P" before my command string, it does not work.
I change to
Convert.ToChar(3)+Convert.ToChar(3)+Convert.ToChar(95)
which does not work either.
what should I do?
here is the code:
[code]
public void AddContextMenuItem()
{
Autodesk.AutoCAD.Interop.AcadApplication acadApp;
Autodesk.AutoCAD.Interop.AcadMenuGroup mnugrpRAA;
acadApp = (Autodesk.AutoCAD.Interop.AcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;
mnugrpRAA = acadApp.MenuGroups.Item(0);
// Menu
Autodesk.AutoCAD.Interop.AcadPopupMenu mnupop;
try
{
mnupop = mnugrpRAA.Menus.Item("TEST");
}
catch
{
mnupop = mnugrpRAA.Menus.Add("TEST");
}
string strCmd;
Autodesk.AutoCAD.Interop.AcadPopupMenuItem mnupopItem;
// todo ^C^C^P
// Menu
strCmd = Convert.ToChar(3)+Convert.ToChar(3)+Convert.ToChar(95) + "LINE" + Convert.ToChar(32);
mnupopItem=mnupop.AddMenuItem(mnupop.Count+1,"Draw Line", strCmd);
}
[/code]
Thank you very much
Merry Christmas
Wes
Windows 10 64 bit, AutoCAD (ACA, Map) 2023