Revit API REST/Cloud

ole.lyso
Contributor
Contributor

Revit API REST/Cloud

ole.lyso
Contributor
Contributor

Hello,

Like many others before this is yet another plea for the development team to update the Revit API to work with .NET, as I'm trying to make a Revit addin work with the Autodesk Forge API and a server setup of my own.

Using the Forge API with .Net Framework 4.8 works alright, but there is no way to test it through 'modern measures' as you would with Postman for instance.  Implementing a REST API through .Net48 is a hassle of going through third party libraries in itself.

Does anyone have experience with making a RESTful API work with a Revit addin? Losing access to the ASPNET functionality really makes this task dreadful. 

0 Likes
Reply
1,124 Views
4 Replies
Replies (4)

Kennan.Chen
Advocate
Advocate

It's officially supported by Microsoft to host ASP.NET WebAPI in any .NET project with some nuget packages.

Self-Host ASP.NET Web API 1 (C#) - ASP.NET 4.x | Microsoft Learn

Use OWIN to Self-Host ASP.NET Web API - ASP.NET 4.x | Microsoft Learn

 

or you can use HttpListener to build a lightweight server to handle local requests.

 

WCF is also a choice for local http server which is not that handy if you prefer RESTful APIs.

0 Likes

jeremy_tammik
Autodesk
Autodesk

I created a whole series of samples demonstrating how to connect the desktop BIM and cloud functionality using the Revit API, REST and node.js. The early samples were born before the advent of APS (formerly Forge), the later ones include it:

  

  

So, everything you are asking for is already there. Your plea is fulfilled.

   

I wish you lots of fun and success implementing your own connection between Revit and cloud.

  

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

niklas473AY
Observer
Observer

That sounds interesting!
One question: Is it possible to access the full functionality of the Revit API on a WebAPI like ASP.NET Core?

 

I have a web app with my own way to structure a building's data and geometry and I want to export it to Revit. 
So creating a Revit file with all elements (walls, slabs, ...) as Revit objects. 

 

Is it possible to have this custom export script on a Web API using the Revit API or is there another way to achieve this?

jeremy_tammik
Autodesk
Autodesk

Your question cannot be answered with yes or no. The answer is pretty complex and depends on many aspects. I would say the official answer is No, and recommendation would be to use the cloud-based APS instead. My DIY- apporach that I point out above tries to prove that the answer can be Yes, for a very limited use case. So, it depends. Please read the material I pointed out above and all will become clear.

  

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