Message 1 of 3

Not applicable
03-13-2020
05:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello friends I have big question. When I want to sign PostcommandId equals UNDO = 33032, I have an exception:
"The Revit command id cannot be assigned a command binding." but when I sign another command there is not happen any exceptions. Why is happened to this command? And how to do it right? This is my code:
First decision:
RevitCommandId commandId = RevitCommandId.LookupPostableCommandId(PostableCommand.Undo);
AddInCommandBinding importBinding = a.CreateAddInCommandBinding(commandId); (An exception occurs here)
importBinding.BeforeExecuted += new EventHandler<Autodesk.Revit.UI.Events.BeforeExecutedEventArgs>(Undo);
Second decision:
RevitCommandId commandId = RevitCommandId.LookupCommandId("ID_BUTTON_UNDO");
AddInCommandBinding importBinding = a.CreateAddInCommandBinding(commandId); (An exception occurs here)
importBinding.BeforeExecuted += new EventHandler<Autodesk.Revit.UI.Events.BeforeExecutedEventArgs>(Undo);
Solved! Go to Solution.