Jump to content

Recommended Posts

Posted

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

Posted

Hex x03 is a control character

equivalent to Control-C ... in this case, sent twice, to Cancel any active command.

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...