Inventor Event Handling

Inventor Event Handling

drewj
Enthusiast Enthusiast
572 Views
1 Reply
Message 1 of 2

Inventor Event Handling

drewj
Enthusiast
Enthusiast

I am looking to set up an event handler in Inventor to track which commands are used and when for logging, can anyone point me in the direction of where to start?

 

in AutoCAD I have used this:

Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.CommandWillStart += new CommandEventHandler(CommandBeginHandler)

 

in Revit I have used this:

AddInCommandBinding namehere = app.CreateAddInCommandBinding(RevitCommandId.LookupCommandId("COMMAND_NAME_HERE"))

 

and in Navisworks I have used this:

Autodesk.Windows.ComponentManager.UIElementActivated += new EventHandler<Autodesk.Windows.UIElementActivatedEventArgs>(OnUiElementActivated)

 

But I cant seem to find a "catch all" event that would work for every command in Inventor, can anyone help?

0 Likes
Accepted solutions (1)
573 Views
1 Reply
Reply (1)
Message 2 of 2

nmunro
Collaborator
Collaborator
Accepted solution

You can subscribe to the UserInputEvents.OnActivateCommand and UserInputEvents.OnTerminateCommand events to catch most of what a user does in Inventor, but it does not fire for all commands. If you install the Developer tools, it includes a very good event watcher application with source code that should be a good reference for you.

 

Neil

 

        


https://c3mcad.com

0 Likes