VB | can't figure out ^C^C in command handler

VB | can't figure out ^C^C in command handler

snappyjazz
Collaborator Collaborator
733 Views
6 Replies
Message 1 of 7

VB | can't figure out ^C^C in command handler

snappyjazz
Collaborator
Collaborator

Hello. I can't figure out how to clear before my command using the command handler. The command line always says it doesn't recognize my command. I've tried:

 RibBtn.CommandParameter = "^C^CCommandName" 

RibBtn.CommandParameter = "^C^C CommandName" 

 

RibBtn.CommandParameter = "CommandName"  the following use this same parameter

Doc.SendStringToExecute(Chr(94) & "C" & Chr(94) & "C" RibBtn.CommandParameter & " ", True, False, False)

Doc.SendStringToExecute("^C^C" & RibBtn.CommandParameter & " ", True, False, False)

 

It does work though if I call just the command name. It feels weird not clearing before calling a command. Any ideas?

0 Likes
Accepted solutions (1)
734 Views
6 Replies
Replies (6)
Message 2 of 7

Jeff_M
Consultant
Consultant

Even though this post is in c# you should be able to see what you need to do:

https://adndevblog.typepad.com/autocad/2012/07/start-command-with-escape-characters-cc.html

 

Another good reason to code in c# vs VB...lots more examples available.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 7

snappyjazz
Collaborator
Collaborator

Thank you. Everything makes sense except the character /x03. Where after googling is a ASCII character; which is different than Chr() characters(See screen shot). I cannot find documentation on how to use ASCII characters in vb.net yet. Do you know off the top of your head?

 

snappyjazz_0-1677107017458.png

 

0 Likes
Message 4 of 7

norman.yuan
Mentor
Mentor

It is not "/x03", but "\x03".

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 5 of 7

snappyjazz
Collaborator
Collaborator

@norman.yuan Thanks for catching that. However I still don't know how to use it and get the ^C like here. A snapshot of my ignorance.

 

snappyjazz_0-1677115504151.png

 

0 Likes
Message 6 of 7

norman.yuan
Mentor
Mentor
Accepted solution

Something like (run command "_.Line", for example):

 

Doc.SendStringToExecute("\x03\x03_.LINE ", True, False, False)

Norman Yuan

Drive CAD With Code

EESignature

Message 7 of 7

snappyjazz
Collaborator
Collaborator

@norman.yuan I think that did it. I was expecting Autocad to not recognize the command; but it did. Thank you!

0 Likes