Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding
Announcements
We are currently migrating data within this board to improve the community. During this process, posting, replying, editing and other features are temporarily disabled. We sincerely apologize for any inconvenience caused and appreciate your understanding. Thank you for your patience and support.

Revit Server REST API and Project Data Exporting

Anonymous
3,317 Views
9 Replies
Message 1 of 10

Revit Server REST API and Project Data Exporting

Anonymous
Not applicable

Hello all:

 

I am completely brand new to Revit and I've only recently (within the last two hours) downloaded the API SDK.  With that being said, I am a seasoned software engineer and I'm well versed in .NET and REST API principles.

 

After reviewing all the documentation and samples, I'm not really seeing what I'm looking for and I'm curious if there is a developer WIKI or more comprehensive information regarding the Revit Server API and its capabilities.

 

The goal I am trying to accomplish is a web API where I can do light bi-directional updates of project data and also relational data exporting for reporting. For example:

 

1) A remote end user can update or add a new piece of equipment or a room to an existing project

2) Given a project all information can be exported to an external SQL SERVER database, json, an xml file, whatever the case may be.

 

#1 Does the current Revit Server API support updating project specific information? I see that there is support for GETS or retrieving information about a given model or entity, and also admin data modifications regarding MOVES, DELETES, etc..but is there the ability to update and add specific detail to a project?

 

Is there any documentation on this?

 

#2 Is there a way to get all information regarding a model/project in a transferable format? I have read a little bit about ODBC links and DBLink, but I'm looking for an API enabled way to get data and then push it into a secondary system.  JSON, CSV, XML I can work with any format and do any of the necessary scrubbing/ETL leg work.

 

I am looking for API friendly/Server side approaches.  I do not want the constraint of having the AutoDesk Revit product installed on the client/consuming machine.

 

Thanks

Reply
Reply
3,318 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable

Bump!....

 

OK, let me restructure my question, since I'm beginning to see my approach probably needs to be tweaked.

 

Is there a way to automate the Export to ODBC/SQL SERVER via the API? I am looking at the RevitServerCommandTool and I have a few ideas of how I can potentially accomplish what I need to.  I see there is the ability to export to dwf for example from the API: new DWFXExportOptions().  Is there any way to automate the Autodesk UI action of choosing Export -> ODBC Database? How are others accomplishing this?

 

In addition, is there the concept of ODBC re-import with Revit?  I don't see any options in the main UI menu.

 

I am willing to think outside of the box here, and I'm also willing to run Macros/API in process to get this accomplished.

 


Thanks again

Reply
Reply
0 Likes
Message 3 of 10

jeremytammik
Autodesk
Autodesk

Dear mkoslof,

 

As you are probably starting to notice, it is not straightforward to access Revit data or drive Revit commands from the outside.

 

However, these topics and numerous workarounds are explored in great depth on The Building Coder blog, so I would suggest that you browse around in there a bit.

 

Best regards,



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Reply
Reply
0 Likes
Message 4 of 10

Anonymous
Not applicable

Jeremy:

 

Thanks for the reply. Yes :), I've seen that blog and that is where I've gotten some of my initial ideas from.  However, I feel like I am missing just one or two "jump off" points to glue everything together. On the building coder blog, or perhaps other links/documentation can you point me to:

 

1) An example/a start up point for exporting an entire Revit Project?  I am getting verse in all the external commands and Macro-based flow of the API, but I don't know the API hiearchary to iterate a project and export all its information. I realize some things such as geometry might not be as straight forward to export and interprete as say "Project Information" such as Project Number and Location.  I also don't care if the export medium is xml, IFC, I just want a starting point for pulling out all information for a given project (iterate all its associations, etc)

 

2) I saw in one of your blog posts that its possible to export data through the API and then re-import it. Does this also entail ODBC or to SQL SERVER? I am fine with perhaps a serialization translation layer, or I can use XML to go between mediums. I am not against writing code :). Can you point me to an example of exporting and then re-importing data into Revit?

 

I appreciate your help. Again, just links to source code or proof of concepts for these specific areas would be great.

 

Thanks

Reply
Reply
0 Likes
Message 5 of 10

Anonymous
Not applicable

First of all, good luck with this. It sounds like you've got quite a lot of work ahead of you.

 

I'd recommend taking a look at the source code for RevitLookup.  It's an addin that comes with the Revit SDK that allows one to browse all of the elements in a model.  It'll be a good starting point for figuring out how to access the data for different kinds of elements.  Unfortunately, you'll quickly notice is that not all model data is accessible through the API.  Nonetheless, it's a good starting point, and you may be able to modify or use some of its code to achieve what you're trying to do.

 

The other addin you'll want to take a look at is the Revit DB Link addin.  It's another one from Autodesk and I think it's available to subscription customers for free.  To automate the export, you may be able to use some sort of UI Automation.  It may be able to export more data than what you'd normally be able to access through the API, but I suspect it would have the same limitations.

 

You may also want to take a look at programs like Codebook and Ideate BIMLink, which have some pretty powerful data import/export capabilities.

 

As much as I'd like to, I don't have time to look into this any further at the moment, but would be very interested in hearing about any solutions you may come up with.

 

Cheers

Reply
Reply
0 Likes
Message 6 of 10

Anonymous
Not applicable

Hi mkoslof! I am in a project  I think that's what I read very similar to yours, in order that I want to achieve is to create a desktop application that can read a file and get .rvt then export data to a SQLServer. 

I would like your advice me!!

 

Reply
Reply
0 Likes
Message 7 of 10

jeremytammik
Autodesk
Autodesk

Dear Mksolof,

 

Here is an item that I have been wanting to post on The Building Coder for ages:

 

The last version of the public RDBLink SDK sample, before it was converted to a subscription module.

 

  • RDBLink_2010.zip attached below

 

The source code is for Revit 2010.

 

I have no idea how useful it might be to migrate it to Revit 2016.

 

It will show you all the principles, at least.

 

Here are the other relevant SDK samples and topics on The Building Coder:

 

 

Have fun and please let m know how you end up solving this.

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Reply
Reply
Message 8 of 10

jeremytammik
Autodesk
Autodesk
Reply
Reply
Message 9 of 10

vicka2228
Community Visitor
Community Visitor

Hi @jeremytammik,

 

Sorry to revive this years old thread. I am looking for the same solution as the original poster, and I found your tool RevitLookup to be very impressive. Is there any way to export the database view from your tool as a dataset file of any format? Preferably through an API. I am looking to integrate this into a separate python backend application, hence the existing solutions of add-ins like pyrevit and dynamo do not work for me. Do you have any idea what I could use? Specifically, I want to be able to create/access the complete dataset of a revit project through my backend whenever the project is opened so that I can process it for further use.

 

Reply
Reply
0 Likes
Message 10 of 10

jeremy_tammik
Autodesk
Autodesk

Glad to hear you like RevitLookup. That is being maintained and enhanced by  @nice3point   nowadays, so your appreciation is also due to him. RevitLookup is open source with an MIT license, so feel free to use its code for your own database access and export purposes. The Building Coder and the Revit SDK samples include many other data export sample applications that you could use, e.g.:

   

 

The complete Revit IFC exporter is also open source:

   

    

So you really have all you need to do anything you like.

  

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