Getting Started Creating Families and RFA Files

Here are some more pointers for getting started generating family definitions and RFA files programmatically:

I am writing this from the Greek island of Euboea, on which I already visited Limni or Λιμνι on the north end a couple of years ago.

This time, I am heading towards its east and south end instead, on my way to the second I love 3D – Athens meetup on June 5, followed by the AngelHack hackathon coming weekend.

For more details, please refer to The 3D Web Coder.

Family Types and Parameters

Question: I am just getting started programmatically creating Revit families.

Where can I find information about the following topics?

Answer: There is lots of information available about these topics.

Much too much for me to list here, or point out to you individually.

Actually, it would be preferable for you to ask your questions in the public Revit API discussion forum instead of raising individual cases for each.

That way, other developers could chip in and help you as well, and our discussions would be visible for others to share and learn from.

All that I can say about using Revit families programmatically via the Revit API is published by The Building Coder.

Search for 'family' or 'families' in the list of topic groups.

The most effective way to determine which parameters you can use in your specific context is to create a BIM manually and then explore that using RevitLookup, BipChecker, and other, more intimate, database exploration tools such as the Revit Python and Ruby shells.

The advantage of the Python and Ruby shells is that they enable you to navigate interactively through the model using all the available API constructs, including method calls, iteration, etc., whereas an exploration based on RevitLookup only has access to statically compiled properties that allow navigation by clicking buttons in automatically generated data grid view forms.

Imperial Internal Revit Database Length Units

Question: I am working in Germany.

For me, one drawing unit is one mm.

If I generate a Revit family definition RFA file with the APIs, 1 mm turns into more than 3000 mm.

Does this have something to do with the American Unit?

What can I do to fix this?

Is there some parameter that I can use to initialise the variable or switch between European and American units?

Answer: Please do confirm that you are in fact aware of the wealth of online information available on Revit before I answer your question.

Have you worked through the getting started material?

Have you performed an Internet search to answer this question of yours?

One of the main entry points for these kind of questions is the Revit API discussion forum.

Aaaw, I can't resist...

Here are some direct pointers for you:

Please search for yourself next time before asking.

Please note that I am perfectly happy to support you in all your questions, but it is a total waste of both your time and ours if you do not do any research yourself at all.

Response: My question is:

How can I scale the Revit object?

If I have an object that is 1 m long and export it to Revit, it shows up as over 3000 m in length.

I think the problem is the difference between the metric and imperial systems.

Do I have to scale the object when exporting, or is some other possibility, e.g., using some property?

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

This cannot be changed.

Revit does not support scaling of building elements, since it represents a realistic BIM model.

In reality, you cannot take an existing wall, window or door and simply scale it up by a factor of 2.

You have to change the wall, window or door type to something larger.

Therefore, that is not possible to scale the building elements in Revit either.

Here is a more detailed explanation on transforming an element.

Therefore, you have to convert your geometry to feet before you create it.

The Building Coder provides a large number of examples of how this can be achieved.

Programmatically Generating Revit Family RFA Files

Question: I am currently producing Revit families at runtime using the APIs of the Revit installation on the client computer.

In the future I would like to create the complete Revit model at runtime on my server.

Are there any Autodesk tools that I can install on my server to generate Revit RFA files without the Revit API?

Answer: The only tools that I am aware of that fall into the categories you are asking about are the sample add-ins provided in the various software developer kits, e.g. the Revit SDK available from the Revit Developer Centre.

They all require the Revit API, i.e., a full Revit installation on the computer and an instance of Revit up and running to provide a valid Revit API context.

Please look at the family creation samples listed in Revit SDK sample readme file SamplesReadMe.htm and The Building Coder topic group on the Family API.