Message 1 of 5
Get command name from autocad electrical
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I would like to add a function to check whether AEWIRENO which a command of autocad electrical has been executed.
Commands such as copy and move can be checked for execution, but AEWIRENO is not recognized in GLOBALNAME.
please tell me how.
My code is below
public void Initialize()
{
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.DocumentLockModeChanged += new DocumentLockModeChangedEventHandler(vetoCommand);
}
private void vetoCommand(object sender, DocumentLockModeChangedEventArgs e)
{
if (e.GlobalCommandName == "COPY")
{
e.Veto();
MessageBox.Show("COPY");
}
if (e.GlobalCommandName == "MOVE")
{
e.Veto();
MessageBox.Show("MOVE");
}
if (e.GlobalCommandName == "AEWIRENO")
{
e.Veto();
MessageBox.Show("AEWIRENO");
}
}