c# – I need to programmatically access the current Autodesk.Revit.DB.Document and ActiveUIDocument from the opened project within my WinForms application

I’ve developed an IExternalCommand add-in for Revit. Now, I’ve created a new WinForms project with a button that automatically opens a Revit project file using

System.Diagnostics.Process.Start(“C:/tmp/wall.rvt”);.

I need to programmatically access the current Autodesk.Revit.DB.Document and ActiveUIDocument from the opened project within my WinForms application. Essentially, I want to trigger the add-in’s functionality directly from my WinForms app, just as it would be when manually invoked from the Revit ribbon. Is there a way to achieve this?

Read more here: Source link