Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Revit Server REST API and Project Data Exporting

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
2716 Views, 7 Replies

Revit Server REST API and Project Data Exporting

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

7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

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

Message 3 of 8
jeremytammik
in reply to: Anonymous

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

Message 4 of 8
Anonymous
in reply to: Anonymous

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

Message 5 of 8
Anonymous
in reply to: Anonymous

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

Message 6 of 8
erickmz4294
in reply to: Anonymous

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!!

 

Message 7 of 8
jeremytammik
in reply to: Anonymous

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

Message 8 of 8
jeremytammik
in reply to: jeremytammik

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community