Get / Retrieve Plug-in function run event

Get / Retrieve Plug-in function run event

MehtaRajesh
Advocate Advocate
885 Views
5 Replies
Message 1 of 6

Get / Retrieve Plug-in function run event

MehtaRajesh
Advocate
Advocate

 

Hello all,
I am able to track File Save Event as below

 

public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)

{

this.uidoc = commandData.Application.ActiveUIDocument;
Autodesk.Revit.ApplicationServices.Application revitApplication = commandData.Application.Application; Autodesk.Revit.ApplicationServices.Application app; Autodesk.Revit.UI.UIApplication m_app; m_app = commandData.Application;
app = m_app.Application;
commandData.Application.ActiveUIDocument.Document.DocumentSaving += Document_DocumentSaving; MessageBox.Show("We are in process", "TITLE", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return Autodesk.Revit.UI.Result.Succeeded;
}

 

private void Document_DocumentSaving(object sender, Autodesk.Revit.DB.Events.DocumentSavingEventArgs e)
{
MessageBox.Show("We are at Save event", "TITLE", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}


My Requirement is to track the external plug-in button press event, (If say One external plug-in loaded in ribbon, and if user presses one of the button, function need to notify) and prior OR after running that function i need to run my own function.

Thanks in advance for your kind support.

Regards,
Raj

0 Likes
Accepted solutions (1)
886 Views
5 Replies
Replies (5)
Message 2 of 6

MehtaRajesh
Advocate
Advocate

Hello All,

Any update on my requirement from Revit API developer specialists OR from Autodesk Product expert ?

Regards,

Raj

0 Likes
Message 3 of 6

jeremy_tammik
Alumni
Alumni

If you just want to keep a log of when your add-in code is executed, the easiest solution is probably to implement a simple logging functionality in the add-in code itself.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 4 of 6

MehtaRajesh
Advocate
Advocate

Thanks for your reply,

But I need to track when particular button pressed from third party plug-in (e.g. UNIFI), for which i do not have control (Source-code) hence i can not do any changes in that plug-in.

Is there any reactor kind of mechanism using which i can notify button pressed ?

Thanks in advance for your further help / support

 

Regards,

Raj

0 Likes
Message 5 of 6

jeremy_tammik
Alumni
Alumni
Accepted solution

I do not believe the Revit API provides a dedicated method or event for this right out of the box.

  

There are a number of indirect solutions that you can use, though:

  

  

There are certainly other further possibilities to achieve this.

    

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 6 of 6

MehtaRajesh
Advocate
Advocate

Thanks a lot, will do required r&d and if able to solve issue, will update it for wider audience

 

0 Likes