Hi Vinoth,
Here's a snippet to get you started. I actually use the UIElementActivated event:
Imports Autodesk.Revit.Attributes
Imports Autodesk.Revit
Imports adWin = Autodesk.Windows
<Transaction(TransactionMode.Manual)> _
<Regeneration(RegenerationOption.Manual)> _
<Journaling(JournalingMode.UsingCommandData)> _
<DisplayName("Application Name")> _
<Description("Application Description")> _
Public Class YourApp
Implements UI.IExternalApplication
Public Function OnStartup(ByVal a As UI.UIControlledApplication) As UI.Result Implements UI.IExternalApplication.OnStartup
'event handler
AddHandler adWin.ComponentManager.UIElementActivated, AddressOf ComponentManager_UIElementActivated
Return UI.Result.Succeeded
End Function
Public Function OnShutdown(ByVal a As UI.UIControlledApplication) As UI.Result Implements UI.IExternalApplication.OnShutdown
RemoveHandler adWin.ComponentManager.UIElementActivated, AddressOf ComponentManager_UIElementActivated
Return UI.Result.Succeeded
End Function
Private Sub ComponentManager_UIElementActivated(ByVal sender As Object, ByVal e As Autodesk.Windows.UIElementActivatedEventArgs)
'do your thing with the e
end sub
end class
Let us know how you get on.
Cheers,
-Matt
Cheers,
-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?