REX Content Generator

I had an absolutely magical experience in Israel before leaving Tel Aviv Thursday afternoon. Among many others at the developer conference on Wednesday, we met with Dima Brickmann of Omnitech, and he suggested going for a short visit to Jerusalem before returning to the airport, which is located between Tel Aviv and Jerusalem. Partha and I decided to join him. Dima has a very special relationship with the city and a deep philosophical and photographical view of it, so he was a unique and wonderful guide. His tour focused more on feeling and experiencing the magic of this deeply religious place, which brings out so many extremes in all the different religions, and yet simultaneously enables them to coexist in an extremely confined area.

By the way, Dima has more recent photos with some short philosophical texts on the Russian photoreporting news web site, e.g. this beautiful photo series on Jerusalem between black and white:

Jerusalem between black and white

I went and installed a translation add-on for my browser to be able to read the Russian text. It works very well, and the photos are really and truly deep and beautiful.

Click on the link at the bottom saying 'ПРОДОЛЖЕНИЕ ФОТОРЕПОРТАЖА' to proceed to the rest of the photos in the series.

Thank you, Dima!

I would never have believed you could experience so much in such a short time, both in the three hours that we spent with Dima in Jerusalem and in the two days we spent in Israel.

On Friday we held another developer conference in Paris, and today we are already en route to Gothenburg in Sweden.

And my backlog of interesting blog posts is growing far faster than I can publish them.

REX Content Generator

One really astounding revelation at the DevLab at AU was the REX content generator sample.

It is provided with the REX framework and its other samples as part of the standard Revit SDK. I had not looked at it previously in any depth, since I have not used REX myself yet. I tend to avoid any additional frills, and the plain vanilla Revit API keeps me fully occupied all on its own. But this sample really bowled me over!

A DevLab participant showed me some of its features, and it looks like an astonishingly powerful tool. Here are a few notes I made from his demo:

The content generator provides the following functionality:


I was!

The family API enables us to create new families step by step. In contrast, the content generator allows you to load an existing family, tweak and change it, and immediately generate a new family.

There is no need to install the Revit extensions to ensure that the basic REX framework is in place and the REX API is available. The content generator can be used even without Revit Extensions installed, since the framework is part of the regular Revit installation and is installed in a way transparent for the user.

To run the content generator sample, simply select a structural element, e.g. a column, and launch the command. It takes a little while to start up, because it reads the three databases: standard, steel and structural.

I asked Emmanuel Weyermann for a short description, and he provided the following brief yet full picture of Content Generator and this sample application:

What is Content Generator?

The Content Generator is a component which is part of the Revit Extensions Framework installed with Revit 2012.

It provides tools for content management. This component is strongly connected with standard databases shipped with Revit (over 130 databases).

Advantages of the Content Generator:

More information may be found in the "User Manual for Extensions SDK.pdf".

Content Generator basic types

The idea of Content Generator is very simple. It provides its own representations of specific types (e.g. sections) and two converters which communicate with each other via these types:

REX Converter Pipeline

Content Generator provides 4 types:

Code sample

The code below presents how to generate a particular section taken from the Rcatpro database:

  // Initializing the rex converter.
  REXFamilyConverter rex = new REXFamilyConverter();
  // Database identification data.
  string alias = "HEA 100";
  string directory = rex.GetDatabaseDirectory(
    ECategoryType.SECTION_DB );
  string dbName = "Rcatpro";
  // Getting the REXFamilyType from the database.
  REXFamilyType_DBSection famDBSection
    = rex.GetFamilyDBSection( EElementType.BEAM,
      EMaterial.STEEL, alias, dbName, directory );
  // Initializing the RVT converter.
  RVTFamilyConverter rvt = new RVTFamilyConverter(
    m_CommandData, true );
  // Getting Revit element.
  Autodesk.Revit.Element el = rvt.GetElement(
    famDBSection );
  FamilySymbol famSymbol = el as FamilySymbol;

Over twenty further samples are provided in the "User Manual for Extensions SDK.pdf".

ContentGeneratorWPF SDK sample

In Extensions SDK may be found the ContentGeneratorWPF sample. It allows examining a selected beam or column and changing its type to a new one (generated by Content Generator).

The sample demonstrates some of Content Generator key features:

The sample runs database browser which allows exploring available databases:

REX Converter Sample Form

Where is Content Generator used?

Many thanks to Emmanuel for this overview!

If you are interested in Revit Structure and structural databases, I strongly encourage you to take a deep look at this if you have not already done so.