.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
.Net equivalent to Esc key
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi all
Rewriting old VBA code in .Net C#. Strugeling with finding a way to send Esc key. Chr(27) worked fine in VBA.
This VBA code is updating the block definition but aborts by Esc key before insertion.
ThisDrawing.SendCommand ("-insert" + vbLf + "STREAM003=C:/CAD/GDIR/Library/STREAM/STREAM003.DW
Tried the same using ACADCMD but this results in 'Requires numeric distance or two points.' in the commandline.
ResultBuffer rb = newResultBuffer();
rb.Add(newTypedValue(5005, "-INSERT"));
rb.Add(newTypedValue(5005, BlockString));
rb.Add(newTypedValue(5005, "y"));
rb.Add(newTypedValue(5005, (char)27));
acedCmd(rb.UnmanagedObject);
Any ideas?
Re: .Net equivalent to Esc key
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Try this one
ResultBuffer rb = new ResultBuffer();
rb.Add(new TypedValue((int)LispDataType.Text, "-INSERT"));
rb.Add(new TypedValue((int)LispDataType.Text, BlockString));
rb.Add(new TypedValue((int)LispDataType.Text, "y"));
rb.Add(new TypedValue((int)LispDataType.Text, @"^C"));
acedCmd(rb.UnmanagedObject);
~'J'~
C6309D9E0751D165D0934D0621DFF27919
Re: .Net equivalent to Esc key
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Sorry, didn't work.
Typing ^C in AutoCAD commandline during an command doesn't help either, so I think we're barking up the wrong tree.
Re: .Net equivalent to Esc key
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi again
Got it working by using
ads_queueexpr("(command \"-insert\" \"" + BlockString + "\" \"y\" ^C)");
Thanks for pointing me at the right tree afterall. ![]()
Cheers
Tore
