.NET

Reply
*Glenn Ryan
Message 1 of 5 (138 Views)

Cancel Command

138 Views, 4 Replies
07-22-2005 03:50 AM
Hi everyone,

I want to be able to spit up a MessageBox with Yes/No when the plot command
is fired, warning the user that they should use the plotting subroutines
rather then the Acad specific plot command.

The MessageBox shows a warning message stating that using the plot command
is against company policy and they can choose Yes to continue or No to
cancel.

Yes just lets the plot command continue as normal, whereas NO should cancel
the plot command.

Does anyone have any ideas or a code snip to accomplish this? I have tried
intercetping DockLockModeChanged and Veto'ing but this didn't appear to
accomplish anything.

Cheers,
Glenn.
*Danny P.
Message 2 of 5 (138 Views)

Re: Cancel Command

07-25-2005 02:52 AM in reply to: *Glenn Ryan
Glenn,

You could redefine the plot command to your own as a simple solution.
Unless they are really desparate, and they knew about the workaround
(".plot"), this should work in most situations. So much easier too.

Hope that helps,
Danny Polkinhorn
WATG
Honolulu

Glenn Ryan wrote:
> Hi everyone,
>
> I want to be able to spit up a MessageBox with Yes/No when the plot command
> is fired, warning the user that they should use the plotting subroutines
> rather then the Acad specific plot command.
>
> The MessageBox shows a warning message stating that using the plot command
> is against company policy and they can choose Yes to continue or No to
> cancel.
>
> Yes just lets the plot command continue as normal, whereas NO should cancel
> the plot command.
>
> Does anyone have any ideas or a code snip to accomplish this? I have tried
> intercetping DockLockModeChanged and Veto'ing but this didn't appear to
> accomplish anything.
>
> Cheers,
> Glenn.
*Glenn Ryan
Message 3 of 5 (138 Views)

Re: Cancel Command

07-25-2005 04:13 AM in reply to: *Glenn Ryan
Danny,

Thanks for that, but I had already considered this and discarded it.
I know too many people who precede all their commands with '.'

Cheers,
Glenn.

"Danny P." wrote in message
news:4909786@discussion.autodesk.com...
Glenn,

You could redefine the plot command to your own as a simple solution.
Unless they are really desparate, and they knew about the workaround
(".plot"), this should work in most situations. So much easier too.

Hope that helps,
Danny Polkinhorn
WATG
Honolulu

Glenn Ryan wrote:
> Hi everyone,
>
> I want to be able to spit up a MessageBox with Yes/No when the plot
> command
> is fired, warning the user that they should use the plotting subroutines
> rather then the Acad specific plot command.
>
> The MessageBox shows a warning message stating that using the plot command
> is against company policy and they can choose Yes to continue or No to
> cancel.
>
> Yes just lets the plot command continue as normal, whereas NO should
> cancel
> the plot command.
>
> Does anyone have any ideas or a code snip to accomplish this? I have tried
> intercetping DockLockModeChanged and Veto'ing but this didn't appear to
> accomplish anything.
>
> Cheers,
> Glenn.
Distinguished Contributor
thenrich
Posts: 267
Registered: ‎12-03-2003
Message 4 of 5 (138 Views)

Re: Cancel Command

07-25-2005 06:18 AM in reply to: *Glenn Ryan
in the beginCommand evant handler wouldn't it be possible to cancel any command?

Private Sub l_AcadApp_BeginCommand(ByVal CommandName As String) Handles l_acadApp.BeginCommand
Try

Select Case CommandName.ToLower
Case "plot"
if msgbox("validation") = no then
e.cancel = true
end if
End Select


Catch ex As Exception
MsgBox(ex.Message & Chr(13) & ex.StackTrace)
End Try
End Sub

Don't know for sure. We're still on 2002 but I thought when I evaluated 2006 it did have that capability
*Glenn Ryan
Message 5 of 5 (138 Views)

Re: Cancel Command

07-26-2005 06:08 AM in reply to: *Glenn Ryan
That's not available either. I forgot to mention that it's C# and
2006...sorry.

I'm still looking for a reliable way to Cancel a command based on a
MessageBox Yes/No answer...whether it's in CommandWillStart or somewhere
else...

Cheers,
Glenn.


wrote in message news:4909923@discussion.autodesk.com...
in the beginCommand evant handler wouldn't it be possible to cancel any
command?

Private Sub l_AcadApp_BeginCommand(ByVal CommandName As String) Handles
l_acadApp.BeginCommand
Try

Select Case CommandName.ToLower
Case "plot"
if msgbox("validation") = no then
e.cancel = true
end if
End Select


Catch ex As Exception
MsgBox(ex.Message & Chr(13) & ex.StackTrace)
End Try
End Sub

Don't know for sure. We're still on 2002 but I thought when I evaluated 2006
it did have that capability

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community