.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cancel Command

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
357 Views, 4 Replies

Cancel Command

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.
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

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.
Message 3 of 5
Anonymous
in reply to: Anonymous

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.
Message 4 of 5
thenrich
in reply to: Anonymous

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
Message 5 of 5
Anonymous
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost