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
295 Views
1 Reply
Message 1 of 2

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

Lee27
Explorer
Explorer

Hi everyone,
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
296 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

Yes. Use an external event:

  

  

Pay attention to the last couple of entries in the topic group list. They are very recent and refer to discussions here in the forum.

  

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