Detecting right mouse click or enter key

Detecting right mouse click or enter key

Anonymous
Not applicable
422 Views
8 Replies
Message 1 of 9

Detecting right mouse click or enter key

Anonymous
Not applicable
could some please help me exit this loop...

Do
Set returnObj = Nothing
ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select text to be
changed: "
If returnObj.ObjectName = "AcDbText" Then
Set AllTextObj(intK) = returnObj
AllTextObj(intK).Highlight (True)
intK = intK + 1
ElseIf returnObj.ObjectName = "AcDbMText" Then
Set AllTextObj(intK) = returnObj
AllTextObj(intK).Highlight (True)
intK = intK + 1
Else
MsgBox "You must select a text object."
End If
Loop

What I want to do is exit the loop if the user right mouse clicks or press
enter on the keyboard. But I also need to know if the user pressed the esc
key so I can't test to see if the GetEntity failed. Any ideas....???

Kevin K. Rhines
0 Likes
423 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
Kevin, Check out the error handling routine in the GetXX class on
www.acadx.com You can take a look at the way I've done it there. I'm sending
him the latest version of the class today.

Regards,
Jacob Dinardi

"Kevin K. Rhines" wrote in message
news:5FDA08E6B30A69AC501BB28CE99EFA22@in.WebX.maYIadrTaRb...
> could some please help me exit this loop...
>
> Do
> Set returnObj = Nothing
> ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select text to be
> changed: "
> If returnObj.ObjectName = "AcDbText" Then
> Set AllTextObj(intK) = returnObj
> AllTextObj(intK).Highlight (True)
> intK = intK + 1
> ElseIf returnObj.ObjectName = "AcDbMText" Then
> Set AllTextObj(intK) = returnObj
> AllTextObj(intK).Highlight (True)
> intK = intK + 1
> Else
> MsgBox "You must select a text object."
> End If
> Loop
>
> What I want to do is exit the loop if the user right mouse clicks or press
> enter on the keyboard. But I also need to know if the user pressed the
esc
> key so I can't test to see if the GetEntity failed. Any ideas....???
>
> Kevin K. Rhines
>
>
0 Likes
Message 3 of 9

Anonymous
Not applicable
Thanks, I think that this will work.

Kevin

"Jacob Dinardi" wrote in message
news:4EF0A0E4289AEA9C212E67A5BE7F2021@in.WebX.maYIadrTaRb...
> Kevin, Check out the error handling routine in the GetXX class on
> www.acadx.com You can take a look at the way I've done it there. I'm
sending
> him the latest version of the class today.
>
> Regards,
> Jacob Dinardi
>
> "Kevin K. Rhines" wrote in message
> news:5FDA08E6B30A69AC501BB28CE99EFA22@in.WebX.maYIadrTaRb...
> > could some please help me exit this loop...
> >
> > Do
> > Set returnObj = Nothing
> > ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select text to be
> > changed: "
> > If returnObj.ObjectName = "AcDbText" Then
> > Set AllTextObj(intK) = returnObj
> > AllTextObj(intK).Highlight (True)
> > intK = intK + 1
> > ElseIf returnObj.ObjectName = "AcDbMText" Then
> > Set AllTextObj(intK) = returnObj
> > AllTextObj(intK).Highlight (True)
> > intK = intK + 1
> > Else
> > MsgBox "You must select a text object."
> > End If
> > Loop
> >
> > What I want to do is exit the loop if the user right mouse clicks or
press
> > enter on the keyboard. But I also need to know if the user pressed the
> esc
> > key so I can't test to see if the GetEntity failed. Any ideas....???
> >
> > Kevin K. Rhines
> >
> >
>
>
0 Likes
Message 4 of 9

Anonymous
Not applicable
Jacob,
The code works great, but I should have been more specific I guess with
my question. What I would really like to do is have the code run more like
AutoCAD's change command. Were as I could select multiple entities and use
a crossing window. Any other idea's or am I simply at a dead end?

Kevin

"Kevin K. Rhines" wrote in message
news:0502E88053D1CA3C9CB266BDF9368362@in.WebX.maYIadrTaRb...
> Thanks, I think that this will work.
>
> Kevin
>
> "Jacob Dinardi" wrote in message
> news:4EF0A0E4289AEA9C212E67A5BE7F2021@in.WebX.maYIadrTaRb...
> > Kevin, Check out the error handling routine in the GetXX class on
> > www.acadx.com You can take a look at the way I've done it there. I'm
> sending
> > him the latest version of the class today.
> >
> > Regards,
> > Jacob Dinardi
> >
> > "Kevin K. Rhines" wrote in message
> > news:5FDA08E6B30A69AC501BB28CE99EFA22@in.WebX.maYIadrTaRb...
> > > could some please help me exit this loop...
> > >
> > > Do
> > > Set returnObj = Nothing
> > > ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select text to be
> > > changed: "
> > > If returnObj.ObjectName = "AcDbText" Then
> > > Set AllTextObj(intK) = returnObj
> > > AllTextObj(intK).Highlight (True)
> > > intK = intK + 1
> > > ElseIf returnObj.ObjectName = "AcDbMText" Then
> > > Set AllTextObj(intK) = returnObj
> > > AllTextObj(intK).Highlight (True)
> > > intK = intK + 1
> > > Else
> > > MsgBox "You must select a text object."
> > > End If
> > > Loop
> > >
> > > What I want to do is exit the loop if the user right mouse clicks or
> press
> > > enter on the keyboard. But I also need to know if the user pressed
the
> > esc
> > > key so I can't test to see if the GetEntity failed. Any ideas....???
> > >
> > > Kevin K. Rhines
> > >
> > >
> >
> >
>
>
0 Likes
Message 5 of 9

Anonymous
Not applicable
"Kevin K. Rhines" wrote in message
news:3DB713B616C0B6C3CC34BCAAF2EE07FD@in.WebX.maYIadrTaRb...
> Jacob,
> The code works great, but I should have been more specific I guess
with
> my question. What I would really like to do is have the code run more
like
> AutoCAD's change command. Were as I could select multiple entities and
use
> a crossing window. Any other idea's or am I simply at a dead end?

I'm a bit confused by what you're asking, given the
original code snippet you posted (detecting how the
user responded to a GetEntity() call).

What exactly do you mean by select multiple entities using
a crossing window, in the context of your original code?

If you want to allow multiple selection using a crossing
window, you can use AcadSelectionSet to do it. Is that
what you had in mind?
0 Likes
Message 6 of 9

Anonymous
Not applicable
You need to create a selection set with SelectOnScreen, which GetXX does not
support yet (Chuck Gabriel and I have been working on it). I believe there
is an arx resource written by Tony T. called acadx.arx (no relation to
acadx.com) that does support this as well as a number of other features.
Sorry I don't have a link for you though.

Jacob

"Kevin K. Rhines" wrote in message
news:3DB713B616C0B6C3CC34BCAAF2EE07FD@in.WebX.maYIadrTaRb...
> Jacob,
> The code works great, but I should have been more specific I guess
with
> my question. What I would really like to do is have the code run more
like
> AutoCAD's change command. Were as I could select multiple entities and
use
> a crossing window. Any other idea's or am I simply at a dead end?
>
> Kevin
>
> "Kevin K. Rhines" wrote in message
> news:0502E88053D1CA3C9CB266BDF9368362@in.WebX.maYIadrTaRb...
> > Thanks, I think that this will work.
> >
> > Kevin
> >
> > "Jacob Dinardi" wrote in message
> > news:4EF0A0E4289AEA9C212E67A5BE7F2021@in.WebX.maYIadrTaRb...
> > > Kevin, Check out the error handling routine in the GetXX class on
> > > www.acadx.com You can take a look at the way I've done it there. I'm
> > sending
> > > him the latest version of the class today.
> > >
> > > Regards,
> > > Jacob Dinardi
> > >
> > > "Kevin K. Rhines" wrote in message
> > > news:5FDA08E6B30A69AC501BB28CE99EFA22@in.WebX.maYIadrTaRb...
> > > > could some please help me exit this loop...
> > > >
> > > > Do
> > > > Set returnObj = Nothing
> > > > ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select text to be
> > > > changed: "
> > > > If returnObj.ObjectName = "AcDbText" Then
> > > > Set AllTextObj(intK) = returnObj
> > > > AllTextObj(intK).Highlight (True)
> > > > intK = intK + 1
> > > > ElseIf returnObj.ObjectName = "AcDbMText" Then
> > > > Set AllTextObj(intK) = returnObj
> > > > AllTextObj(intK).Highlight (True)
> > > > intK = intK + 1
> > > > Else
> > > > MsgBox "You must select a text object."
> > > > End If
> > > > Loop
> > > >
> > > > What I want to do is exit the loop if the user right mouse clicks or
> > press
> > > > enter on the keyboard. But I also need to know if the user pressed
> the
> > > esc
> > > > key so I can't test to see if the GetEntity failed. Any
ideas....???
> > > >
> > > > Kevin K. Rhines
> > > >
> > > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 7 of 9

Anonymous
Not applicable
thanks I will take a look.

Kevin K. Rhines

"Jacob Dinardi" wrote in message
news:728C6F6F8AB5A437E19C63AF54F5446D@in.WebX.maYIadrTaRb...
> You need to create a selection set with SelectOnScreen, which GetXX does
not
> support yet (Chuck Gabriel and I have been working on it). I believe there
> is an arx resource written by Tony T. called acadx.arx (no relation to
> acadx.com) that does support this as well as a number of other features.
> Sorry I don't have a link for you though.
>
> Jacob
>
> "Kevin K. Rhines" wrote in message
> news:3DB713B616C0B6C3CC34BCAAF2EE07FD@in.WebX.maYIadrTaRb...
> > Jacob,
> > The code works great, but I should have been more specific I guess
> with
> > my question. What I would really like to do is have the code run more
> like
> > AutoCAD's change command. Were as I could select multiple entities and
> use
> > a crossing window. Any other idea's or am I simply at a dead end?
> >
> > Kevin
> >
> > "Kevin K. Rhines" wrote in message
> > news:0502E88053D1CA3C9CB266BDF9368362@in.WebX.maYIadrTaRb...
> > > Thanks, I think that this will work.
> > >
> > > Kevin
> > >
> > > "Jacob Dinardi" wrote in message
> > > news:4EF0A0E4289AEA9C212E67A5BE7F2021@in.WebX.maYIadrTaRb...
> > > > Kevin, Check out the error handling routine in the GetXX class on
> > > > www.acadx.com You can take a look at the way I've done it there. I'm
> > > sending
> > > > him the latest version of the class today.
> > > >
> > > > Regards,
> > > > Jacob Dinardi
> > > >
> > > > "Kevin K. Rhines" wrote in message
> > > > news:5FDA08E6B30A69AC501BB28CE99EFA22@in.WebX.maYIadrTaRb...
> > > > > could some please help me exit this loop...
> > > > >
> > > > > Do
> > > > > Set returnObj = Nothing
> > > > > ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select text to
be
> > > > > changed: "
> > > > > If returnObj.ObjectName = "AcDbText" Then
> > > > > Set AllTextObj(intK) = returnObj
> > > > > AllTextObj(intK).Highlight (True)
> > > > > intK = intK + 1
> > > > > ElseIf returnObj.ObjectName = "AcDbMText" Then
> > > > > Set AllTextObj(intK) = returnObj
> > > > > AllTextObj(intK).Highlight (True)
> > > > > intK = intK + 1
> > > > > Else
> > > > > MsgBox "You must select a text object."
> > > > > End If
> > > > > Loop
> > > > >
> > > > > What I want to do is exit the loop if the user right mouse clicks
or
> > > press
> > > > > enter on the keyboard. But I also need to know if the user
pressed
> > the
> > > > esc
> > > > > key so I can't test to see if the GetEntity failed. Any
> ideas....???
> > > > >
> > > > > Kevin K. Rhines
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
0 Likes
Message 8 of 9

Anonymous
Not applicable
Tony,
Sorry for the confusion I originally did use selection set, but again
how do I detect that the user has pressed the enter key or right mouse
clicked?

Kevin K. Rhines



"Tony Tanzillo" wrote in message
news:96575CF1B1F00BF14FAD3473545EB422@in.WebX.maYIadrTaRb...
> "Kevin K. Rhines" wrote in message
> news:3DB713B616C0B6C3CC34BCAAF2EE07FD@in.WebX.maYIadrTaRb...
> > Jacob,
> > The code works great, but I should have been more specific I guess
> with
> > my question. What I would really like to do is have the code run more
> like
> > AutoCAD's change command. Were as I could select multiple entities and
> use
> > a crossing window. Any other idea's or am I simply at a dead end?
>
> I'm a bit confused by what you're asking, given the
> original code snippet you posted (detecting how the
> user responded to a GetEntity() call).
>
> What exactly do you mean by select multiple entities using
> a crossing window, in the context of your original code?
>
> If you want to allow multiple selection using a crossing
> window, you can use AcadSelectionSet to do it. Is that
> what you had in mind?
>
>
0 Likes
Message 9 of 9

Anonymous
Not applicable
The right mouse is configurable to display context
menus, or issue the command assigned in the AUXxxx
menu (or ENTER), so it is not simply a matter of
detecting a right-click.

For finding out how the user exited selection, the
ERRNO system variable might be of use.

"Kevin K. Rhines" wrote in message
news:48A45018794B40B1F551B514A1123F68@in.WebX.maYIadrTaRb...
> Tony,
> Sorry for the confusion I originally did use selection set, but again
> how do I detect that the user has pressed the enter key or right mouse
> clicked?
>
> Kevin K. Rhines
>
>
>
> "Tony Tanzillo" wrote in message
> news:96575CF1B1F00BF14FAD3473545EB422@in.WebX.maYIadrTaRb...
> > "Kevin K. Rhines" wrote in message
> > news:3DB713B616C0B6C3CC34BCAAF2EE07FD@in.WebX.maYIadrTaRb...
> > > Jacob,
> > > The code works great, but I should have been more specific I guess
> > with
> > > my question. What I would really like to do is have the code run more
> > like
> > > AutoCAD's change command. Were as I could select multiple entities
and
> > use
> > > a crossing window. Any other idea's or am I simply at a dead end?
> >
> > I'm a bit confused by what you're asking, given the
> > original code snippet you posted (detecting how the
> > user responded to a GetEntity() call).
> >
> > What exactly do you mean by select multiple entities using
> > a crossing window, in the context of your original code?
> >
> > If you want to allow multiple selection using a crossing
> > window, you can use AcadSelectionSet to do it. Is that
> > what you had in mind?
> >
> >
>
>
0 Likes