Revit API in VSTO Project

Revit API in VSTO Project

sasuarezr
Observer Observer
251 Views
1 Reply
Message 1 of 2

Revit API in VSTO Project

sasuarezr
Observer
Observer

Hi everyone,

 

I would like to know if it is possible to use the Revit API inside an Excel VSTO project, and if so then how should I set up the project in Visual Studio. What I want is to be able to interact with a Revit file from an Excel Add-In through a custom Excel ribbon tab made in a VS Excel VSTO Add-In project.

 

Thanks in advance,

 

Sincerely, Santiago

0 Likes
252 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

No, not directly:

    

The Revit API requires a valid Revit API context. Such a context is only provided within the event handler of a Revit API event. Such an event requires a running Revit add-in and a running Revit session. 

  

Yes, indirectly:

  

You can presumably achieve what you need anyway, by implementing a Revit add-in that defines an external event:

  

https://www.revitapidocs.com/2024/05089477-4612-35b2-81a2-89c4f44370ea.htm

  

You can raise the external event from your Excel add-in and access the Revit API in the event handler.

  

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