I would like to be able to register which commands are being used within the Revit aplication C#.
To do so, I am trying with the CommandEventArgs.
I know that it is possible to register when the RevitCommandId is the same as e.g. "ID_OBJECTS_WALL" by using the ExecutedEventArgs:
AddInCommandBinding importBindingID_OBJECTS_WALL = application.CreateAddInCommandBinding(RevitCommand Id.LookupCommandId("ID_OBJECTS_WALL"));
importBindingID_WINDOW_CLOSE_HIDDEN.Executed += new EventHandler
<Autodesk.Revit.UI.Events.ExecutedEventArgs>((send er, arg) => application_Command(sender, arg, "ID_OBJECTS_WALL"));
However, I would like to register ANY command that the user fires and thus, it's not very feasible to use the ExecutedEventArgs with AddInCommandBinding for all Revit commands (+1200).
To do so, I am trying with the CommandEventArgs:
UIControlledApplication.CreateAddInCommandBinding( RevitCommandId) += new EventHandler
<Autodesk.Revit.UI.Events.CommandEventArgs>(applic ation_Command);
But I am not sure which namespaces and classes to use, to successfully handle this event, I'm not sure if I should use the UIControlledApplication, I'm not sure if I should use the CreateAddInCommandBinding. I have been looking at the Revit Api Docs but I couldn't figure it out.
Is it possible to register ANY command with the CommandEventArgs or the ExecutedEventArgs?
How can I achieve that?
Any help would be appretiated.
To do so, I am trying with the CommandEventArgs.
I know that it is possible to register when the RevitCommandId is the same as e.g. "ID_OBJECTS_WALL" by using the ExecutedEventArgs:
AddInCommandBinding importBindingID_OBJECTS_WALL = application.CreateAddInCommandBinding(RevitCommand Id.LookupCommandId("ID_OBJECTS_WALL"));
importBindingID_WINDOW_CLOSE_HIDDEN.Executed += new EventHandler
<Autodesk.Revit.UI.Events.ExecutedEventArgs>((send er, arg) => application_Command(sender, arg, "ID_OBJECTS_WALL"));
However, I would like to register ANY command that the user fires and thus, it's not very feasible to use the ExecutedEventArgs with AddInCommandBinding for all Revit commands (+1200).
To do so, I am trying with the CommandEventArgs:
UIControlledApplication.CreateAddInCommandBinding( RevitCommandId) += new EventHandler
<Autodesk.Revit.UI.Events.CommandEventArgs>(applic ation_Command);
But I am not sure which namespaces and classes to use, to successfully handle this event, I'm not sure if I should use the UIControlledApplication, I'm not sure if I should use the CreateAddInCommandBinding. I have been looking at the Revit Api Docs but I couldn't figure it out.
Is it possible to register ANY command with the CommandEventArgs or the ExecutedEventArgs?
How can I achieve that?
Any help would be appretiated.
Comment