.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

^C^C^P in .net

5 REPLIES 5
Reply
Message 1 of 6
wesbird
613 Views, 5 Replies

^C^C^P in .net

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
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: wesbird

Try

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

Daniel
Message 3 of 6
wesbird
in reply to: wesbird

thank you, it works great



Wes
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
Message 4 of 6
Anonymous
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.
Message 5 of 6
wesbird
in reply to: wesbird

in add references:
COM tab
ObjectARX 16.0
AutoCAD 2006 Type Library
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
Message 6 of 6
Anonymous
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report