Escape in SendCommand

Escape in SendCommand

Anonymous
Not applicable
1,552 Views
7 Replies
Message 1 of 8

Escape in SendCommand

Anonymous
Not applicable
I am trying to send a command from an ActiveX control, and I would like it
to work much the way the toolbar buttons do. For example if you want to
program a button to draw a line inside of AutoCAD you simply program the
button with "^C^C _line" This doesn't seem to work from within VB and my
ActiveX control. Anyone have any thoughts? BTW, I really do need to use the
sendcommand, I know that there are other ways to draw a line from VB.

Thanks,
Rob
0 Likes
1,553 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
^C represents ASCII 03 (Cancel).

Send a Chr(3) and see if that works.

Rob Brown wrote:
>
> I am trying to send a command from an ActiveX control, and I would like it
> to work much the way the toolbar buttons do. For example if you want to
> program a button to draw a line inside of AutoCAD you simply program the
> button with "^C^C _line" This doesn't seem to work from within VB and my
> ActiveX control. Anyone have any thoughts? BTW, I really do need to use the
> sendcommand, I know that there are other ways to draw a line from VB.
>
> Thanks,
> Rob

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 3 of 8

Anonymous
Not applicable
Chr(3) is ESCAPE

--
Get free software and more at http://www2.stonemedia.com/~franko

"Rob Brown" wrote in message
news:8ECCAD872rbrownautometriccom@167.216.128.159...
> I am trying to send a command from an ActiveX control, and I would like it
> to work much the way the toolbar buttons do. For example if you want to
> program a button to draw a line inside of AutoCAD you simply program the
> button with "^C^C _line" This doesn't seem to work from within VB and my
> ActiveX control. Anyone have any thoughts? BTW, I really do need to use
the
> sendcommand, I know that there are other ways to draw a line from VB.
>
> Thanks,
> Rob
0 Likes
Message 4 of 8

Anonymous
Not applicable
Sorry Rob. I didn't see the last part of your post. No, you don't have to
use SendCommand to draw line from ActiveX. Just use the AddLine method of
the ModelSpace object.

--
Get free software and more at http://www2.stonemedia.com/~franko

"Frank Oquendo" wrote in message
news:874veg$fcv1@adesknews2.autodesk.com...
> Chr(3) is ESCAPE
>
> --
> Get free software and more at http://www2.stonemedia.com/~franko
>
> "Rob Brown" wrote in message
> news:8ECCAD872rbrownautometriccom@167.216.128.159...
> > I am trying to send a command from an ActiveX control, and I would like
it
> > to work much the way the toolbar buttons do. For example if you want to
> > program a button to draw a line inside of AutoCAD you simply program the
> > button with "^C^C _line" This doesn't seem to work from within VB and my
> > ActiveX control. Anyone have any thoughts? BTW, I really do need to use
> the
> > sendcommand, I know that there are other ways to draw a line from VB.
> >
> > Thanks,
> > Rob
>
>
0 Likes
Message 5 of 8

Anonymous
Not applicable
Frank Oquendo wrote:
>
> Chr(3) is ESCAPE

Wrong again.

Chr(03) is ^C (look it up on any ASCII table), and Chr(3)
is what AutoCAD receives when ^C appears in a menu macro.

ESCape is Chr(27)

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 6 of 8

Anonymous
Not applicable
No Frank,

You were right with the first response, I DON"T WANT TO use the addline
method. What I have done is added some icons to the dockable container, and
want them to work as they do in AutoCAD normally I thought that I tried the
CHR(3) but with the day I've had I may have mistyped.

Thanks for the response,
Rob

franko@nospam.stonemedia.com (Frank Oquendo) wrote in
<874vr1$fdi4@adesknews2.autodesk.com>:

>Sorry Rob. I didn't see the last part of your post. No, you don't have
>to use SendCommand to draw line from ActiveX. Just use the AddLine
>method of the ModelSpace object.
>
>--
>Get free software and more at http://www2.stonemedia.com/~franko
>
>"Frank Oquendo" wrote in message
>news:874veg$fcv1@adesknews2.autodesk.com...
>> Chr(3) is ESCAPE
>>
>> --
>> Get free software and more at http://www2.stonemedia.com/~franko
>>
>> "Rob Brown" wrote in message
>> news:8ECCAD872rbrownautometriccom@167.216.128.159...
>> > I am trying to send a command from an ActiveX control, and I would
>> > like
>it
>> > to work much the way the toolbar buttons do. For example if you
>> > want to program a button to draw a line inside of AutoCAD you simply
>> > program the button with "^C^C _line" This doesn't seem to work from
>> > within VB and my ActiveX control. Anyone have any thoughts? BTW, I
>> > really do need to use
>> the
>> > sendcommand, I know that there are other ways to draw a line from
>> > VB.
>> >
>> > Thanks,
>> > Rob
>>
>>
>
>
0 Likes
Message 7 of 8

Anonymous
Not applicable
So did Chr(3) work for you?

--
Get free software and more at http://www2.stonemedia.com/~franko

"Rob Brown" wrote in message
news:8ECCA9F4Brbrownautometriccom@167.216.128.159...
> No Frank,
>
> You were right with the first response, I DON"T WANT TO use the addline
> method. What I have done is added some icons to the dockable container,
and
> want them to work as they do in AutoCAD normally I thought that I tried
the
> CHR(3) but with the day I've had I may have mistyped.
>
> Thanks for the response,
> Rob
>
> franko@nospam.stonemedia.com (Frank Oquendo) wrote in
> <874vr1$fdi4@adesknews2.autodesk.com>:
>
> >Sorry Rob. I didn't see the last part of your post. No, you don't have
> >to use SendCommand to draw line from ActiveX. Just use the AddLine
> >method of the ModelSpace object.
> >
> >--
> >Get free software and more at http://www2.stonemedia.com/~franko
> >
> >"Frank Oquendo" wrote in message
> >news:874veg$fcv1@adesknews2.autodesk.com...
> >> Chr(3) is ESCAPE
> >>
> >> --
> >> Get free software and more at http://www2.stonemedia.com/~franko
> >>
> >> "Rob Brown" wrote in message
> >> news:8ECCAD872rbrownautometriccom@167.216.128.159...
> >> > I am trying to send a command from an ActiveX control, and I would
> >> > like
> >it
> >> > to work much the way the toolbar buttons do. For example if you
> >> > want to program a button to draw a line inside of AutoCAD you simply
> >> > program the button with "^C^C _line" This doesn't seem to work from
> >> > within VB and my ActiveX control. Anyone have any thoughts? BTW, I
> >> > really do need to use
> >> the
> >> > sendcommand, I know that there are other ways to draw a line from
> >> > VB.
> >> >
> >> > Thanks,
> >> > Rob
> >>
> >>
> >
> >
>
0 Likes
Message 8 of 8

Anonymous
Not applicable
Thanks for the responses, I got it to work, I didn't think about doing it
that way, it makes a lot of sense. I wrote this neat little tiny app that
sends me the ASCII code of any key that you hit.
Tony, you're right, but for my purposes either string works...

Thanks,
Rob

tony.tanzillo@worldnet.att.net (Tony Tanzillo) wrote in <3896031C.4DFDCA28
@worldnet.att.net>:

>Frank Oquendo wrote:
>>
>> Chr(3) is ESCAPE
>
>Wrong again.
>
>Chr(03) is ^C (look it up on any ASCII table), and Chr(3)
>is what AutoCAD receives when ^C appears in a menu macro.
>
>ESCape is Chr(27)
>
>
0 Likes