.NET

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

^C^C^P in .net

302 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
Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
Distinguished Contributor
dmarcotte4
Posts: 195
Registered: ‎04-02-2005
Message 2 of 6 (302 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: 359
Registered: ‎12-05-2003
Message 3 of 6 (302 Views)

Re: ^C^C^P in .net

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



Wes
Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
Member
herry
Posts: 4
Registered: ‎11-30-2005
Message 4 of 6 (302 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: 359
Registered: ‎12-05-2003
Message 5 of 6 (302 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
Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
Member
herry
Posts: 4
Registered: ‎11-30-2005
Message 6 of 6 (302 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
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.