RMS Posted November 7, 2010 Posted November 7, 2010 I am curious because I am trying to simulate an enter command BUT using .SendKeys does not seem to work in a class library acad project? So I was thinking maybe the bellow example is a possible alternative so does anyone know what "\x03\x03" is? Thanks. [color=green] // First cancel any running command[/color] [color=blue]if[/color] (doc.CommandInProgress != [color=maroon]""[/color] && doc.CommandInProgress != [color=maroon]"CD"[/color]) { [color=teal]AcadDocument[/color] oDoc = ([color=teal]AcadDocument[/color])doc.AcadDocument; oDoc.SendCommand([color=maroon]"\x03\x03"[/color]); } code is from here: http://through-the-interface.typepad.com/through_the_interface/2007/03/closing_all_ope.html Quote
Kerry Brown Posted November 7, 2010 Posted November 7, 2010 Hex x03 is a control character equivalent to Control-C ... in this case, sent twice, to Cancel any active command. Quote
RMS Posted November 9, 2010 Author Posted November 9, 2010 That is kinda cool, but .SendComand would not work in my 2008 so I had to use this, and I found out that a space or two can simulate an enter. [size=2]acDoc.SendStringToExecute([/size][size=2][color=#a11f12]"._erase _all "[/color][/size][size=2], [/size][size=2][color=blue]True[/color][/size][size=2], [/size][size=2][color=blue]False[/color][/size][size=2], [/size][size=2][color=blue]False[/color][/size][size=2])[/size] Thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.