.NET

Reply
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 1 of 6 (294 Views)

^C^C^P in .net

294 Views, 5 Replies
11-22-2005 02:08 PM
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
Distinguished Contributor
dmarcotte4
Posts: 195
Registered: ‎04-02-2005
Message 2 of 6 (294 Views)

Re: ^C^C^P in .net

11-22-2005 07:09 PM in reply to: wesbird
Try

strCmd = "\x001b\x001b\x005f" + “LINE” + “\x0020”;

Daniel
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 3 of 6 (294 Views)

Re: ^C^C^P in .net

11-23-2005 05:42 AM in reply to: wesbird
thank you, it works great



Wes
Member
herry
Posts: 4
Registered: ‎11-30-2005
Message 4 of 6 (294 Views)

Re: ^C^C^P in .net

12-08-2005 05:08 PM in reply to: wesbird
Sorry. I can't run it. It appear "Interop" is not in the "Autodesk.AutoCAD" .What kind of reference should I use? thanks a lot.
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 5 of 6 (294 Views)

Re: ^C^C^P in .net

12-09-2005 06:03 AM in reply to: wesbird
in add references:
COM tab
ObjectARX 16.0
AutoCAD 2006 Type Library
Member
herry
Posts: 4
Registered: ‎11-30-2005
Message 6 of 6 (294 Views)

Re: ^C^C^P in .net

12-11-2005 07:37 PM in reply to: wesbird
Thanks a lot. But this way only can be used in the menu. Waht I want is in the program I want to stop a program befor I SendStringToExecute to execute. Is it possible? Thanks in advance.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.