Revit Database

It has been a while since I want to export a whole Revit project to a database. I had a few prior experiences with MySQL and the SQL management software Toad, but never with the Revit database.
This time, I decide to use the SQL Server, along with its SQL Server Management Studio, the solution developed by Microsoft.
During my first research for exporting the Revit database, I came across the Revit DB Link, a plug-in available at Autodesk Subscription website. This add-in allows to export the Revit database, but also to edit this database and import it back into Revit.
Using it is pretty easy when you have all the correct software installed.

Exporting

First, you have to configure a new connection. After starting the Revit DB Link add-in, select [Select a new connection] in the ODBC panel, and click Export:

LinkInterfaceType a name for your export configuration, and select New. Select the SQL Server database, and follow the indication for creating the link file toward your database.
At this windows, fill in the description of your database, and select the SQL server you want to connect. Here, I am working with an SQL server named SQLEXPRESS:

DBSelection
Select a specific database for this export. I have created mine through SQL Management Studio before starting my export. After a summary page, the connection is established.
The export run smoothly, and I get a bunch of tables, one per Revit category, along with others with a more cryptic name.

Using

One of the most obvious application is to create multi-model schedules. Creating a schedule on multiples Revit files can be very tedious, especially with large models. Exporting every Revit files in its own database allow us to merge quantities with a simple UNION SQL command. You just have to make sure to export each new model to a new database to avoid DB link to override previous model export.
Most parameters editable in Revit can also be changed in the database and imported back in Revit model.
As an example, you can edit duct width in the database, and import back values to modify the Revit duct sizes:
 SQLEDit
Before:
BeforeAfter:
After
There is also some specific tables to access relations between Revit objects.
For example, the DoorWall table links each door with its hosting wall. The RoomAssociations table allows us to retrieve every elements inserted into a specific room, to create furniture schedules for example.
Exporting the Revit database to an SQL Server can be a very powerful tool, and provide us new means for creating complex schedules.

The great mystery behind shared coordinates

To make thinks clear for myself and for some of my colleagues, I play with some models in order to understand how Revit coordinates works. Here is the result of my work.

Every Revit model contains two systems of coordinates, represented by two points:
– A Project Base Point (the circle): This is the real center of the current model.
Drawing something too far from this origin will display the following message:

error

– A Survey Point (the triangle): This is the position of our project in the real world (yes, you know, the one outside Revit …).
The angle between these two systems of coordinate is called “Angle to True North”.

There is three possibilities for automatically positioning a Revit linked model into another:

PositionningThe Center to Center option inserts the “center” of our linked model on the “center” of the host model. The center is not very well defined, and correspond more or less to the general geometric center of the elements drawn in the model. For example (the linked model is in blue):

CenterToCenterThe Origin to Origin option inserts the linked model with its Project Base point aligned with the one of the host model.

Origin to OriginAnd finally, the By Shared Coordinates inserts the linked model with the Survey Points overlapping.

BySharedCoordinatesThis particular insertion method is especially useful when dealing with multiple buildings on a site.
As an example, on this Site model, I have two implantations for two buildings (in magenta). My Survey Point is located on the origin point of the whole site.

SiteModelI create my first building, with the Project Base Point and the Survey Point basically at the center of the model.

Building1I insert roughly this building in my site model, and manually place it on its final location:

InsertBuilding1I can know share the coordinates of my site model to my first building.
This will change the position of the Survey Point in my Builnding1 model:

SurveyPointBuilding1If I repeat the whole process with my second building, the three models will share the same system of coordinates through their Survey Point. By selecting Auto – By Shared Coordinate on insertion, every model will be placed correctly regarding the others.

It is also possible to manually move the Project Origin Point or the Survey Point. In this case, the small clip button will determine which point is moving regarding the other:
In this case, the selected point will be moving:

PointMovingIf so, the rest of the model will be moving around the selected point:

RestMovingThe difference can be subtle, don’t hesitate to play with it in order to understand how it works.