Units and RevitLookup

Here is a typical question from a Revit API newbie that prompts me to reiterate some important basic beginner information on units and the RevitLookup tool for exploring the Revit database:

Question: How can I retrieve the length and mass units from a Revit document?

Answer: The internal Revit database length unit is always imperial feet.

That cannot be changed, so there is you answer for that.

Similarly, the internal database unit for weight is kg, as far as I know.

Revit Database Units

In fact, most internal Revit database units except length are

SI units
,
and

length is handled differently
.

The user interface can display other units, set up just as the user prefers.
They can also be modified programmatically, as demonstrated by the
ProjectUnit SDK sample.

You can determine any internal database unit by setting the value of a given parameter using it on some Revit element to a specific number, e.g. 1.0, in the user interface.

You can then use RevitLookup to examine the parameter’s resulting underlying database value.

The quotient between the user display and the underlying database values provides a factor that you can use to convert between user display and internal database units and enables you to determine what the internal database unit actually is.

This topic has been discussed exhaustively on The Building Coder blog.
In fact, one of the very first posts ever is still perfectly valid.
It deals with and covers all the

fundamental facts of units
.

We presented a

unit conversion tool
and
updated it for Revit
2011 and
2013.

Many other aspects of this topic are collected in The Building Coder

units category
.

RevitLookup

I mentioned RevitLookup above.
This is one of the most important tools, both for developers and end users, that you absolutely must be aware of.

It was formerly named RvtMgdDbg.
This

detailed description
still
calls it so.

Here are

step-by-step installation instructions
for
Revit 2011 that pretty much still apply.
There is even a

video demonstrating the installation for Revit 2013
.

RevitLookup is included in the Revit SDK available from the
Revit Developer Center,
which also includes all the other important material for

getting started with the Revit API
.
Here is also an updated version with a

corrected add-in manifest file

to simplify the installation.

I hope that fully answers your question and helps you get started successfully.


Comments

4 responses to “Units and RevitLookup”

  1. Hi Jeremy, Rebuilding the latest RevitLookup as discussed above results in 91 Warnngs about obsolete classes and methods. Is there an updated version for 2013? Thanks, Dale

  2. Bret Thompson Avatar
    Bret Thompson

    RevitLookup appears to not be included in the 2014 SDK, and the old version fails due to changes in the API. Has anyone made a 2014 version of this tool?

  3. David Christie Avatar
    David Christie

    Hi Jeremy, I really enjoying reading your posts on thebuildingcode.
    Do you know if there are any codes been created to automatically create room elevations?
    Thanks,
    David Christie

  4. Dear David,
    Thank you for your appreciation.
    Glad you like it.
    Yes, sure:
    http://thebuildingcoder.typepad.com/blog/2011/08/floor-creation.html
    Cheers, Jeremy.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading