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

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

Lee27
Explorer Explorer
585 Views
3 Replies
Message 1 of 4

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

Lee27
Explorer
Explorer

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?

0 Likes
Accepted solutions (1)
586 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni

Me too.

   

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

Lee27
Explorer
Explorer

Haha, apologies, I posted the wrong thing @jeremy_tammik ,
Here's my actual question:
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?

0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni
Accepted solution

Yes. I answered your identical question in your duplicate thread:

  

   

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