Revit Writing in FME Form

Safe Software Support Team Member
Safe Software Support Team Member
  • Updated

FME Version

  • FME 2023.0

Introduction

FME can readily read from and write to Autodesk Revit project files (.rvt). This capability allows users to work directly with their native Revit elements in an FME workflow, alleviating the need to export elements to an intermediary format. This article will provide an overview of the Revit writer, and demonstrate how this writer can create Revit project files in FME Form.

 

The Revit Writer - An Overview

Introduced for FME 2023.0, the Revit writer transforms input 3D features into valid Revit elements by: 

  • accessing a user-specified Revit template file (.rte or .rvt); 
  • writing input features to this template file; and 
  • saving the adjusted template as a new project file (.rvt) 

To support these actions, the Revit writer has one format-specific parameter: Template File. This parameter’s value must point to the Revit template file (.rte or .rvt) to be used as the starting point for writing input features. The Revit writer cannot create new project files without first starting from a template file. Input features are written to this target template file as Generic Model elements.  

WriterTemplateParam.jpg

Only 3D features whose fme_type = fme_surface  are valid inputs for the Revit writer, excluding topographic surfaces. To ensure input features have closed and valid 3D geometry, it is recommended to pass features through a GeometryValidator transformer before writing them with the Revit writer.

Also note that the Revit writer expects input features to have a coordinate system measured in Revit's internal units (feet). It is therefore recommended to verify that the coordinate system of input features meets this requirement before writing with the Revit writer.

The Revit writer will write any built-in (or “out-of-the-box”) Revit parameter that it recognizes on incoming features. These built-in parameters must be feature attributes that adhere to the following naming convention:

<ParameterSetName>.<ParameterName>        eg. IdentityDataName

This attribute naming convention is the same format that the Revit reader follows when generating feature attributes from the built-in parameters of source Revit elements.

The Revit writer also recognizes and writes those Rich Parameter Attributes generated by the Revit reader when the Read Rich Parameter Attributes option is enabled. These generated feature attributes will have a similar naming convention as above, but with an additional segment appended to the attribute name. 

<ParameterSetName>.<ParameterName>.<RichParameterAttribute>     
eg
.   IdentityData.Name.ParameterID  IdentityData.Name.ParameterType

The appended segment ensures that each generated FME feature attribute is unique to the corresponding Revit built-in parameter from which it was derived. This name add-on helps avoid attribute naming conflicts on written features for situations where many Revit built-in parameters might otherwise map to one FME feature attribute.

Built-in parameters and Rich Parameter Attributes may be created readily with FME’s various attribute-handling transformers. However, to ensure correct formatting for writing, it is best to read these attributes into the workspace with the Revit reader and some source Revit data, where possible. Be sure to enable the reader’s Read Rich Parameter Attributes option to generate these additional attributes. More information about FME’s representation of Revit’s built-in parameters can be found in this FME documentation.

The Revit writer is also able to apply color to written elements, but not texture. Color may be readily applied to input features by making use of FME’s AppearanceSetter transformer, as shown in the example below.
 

Step-By-Step Instructions

This example will show how to adjust the color of door elements from a source Revit project file, and then write these adjusted elements to a new Revit project file using a blank template file in the Revit writer. Please download the attached FME template workspace, RevitWriting_2023.fmwt, to follow along with the example described below. At minimum, FME Form 2023.0 is required to open this workspace.

1. Open RevitWriting_2023.fmwt in FME Workbench 2023.0+
Open RevitWriting_2023.fmwt in FME Workbench 2023.0+, and save it locally. This workspace makes use of two sample files. The first, rac_basic_simple_project.rvt, is the source project file read by FME’s Revit reader and provides some basic elements to work with. Please download this file from Autodesk’s Revit Sample Project Files repository. Note, clicking on this Autodesk link will automatically download the project file. 

SourceProjectFile.jpg
The source project file as rendered in Autodesk Revit 2023, with two exterior doors highlighted. 

The second file, Architectural_Blank.rte, serves as a blank Revit template file that the writer will access as its starting point for writing input features. This file is included with the template workspace.  

2. Run the Revit Reader Feature Types Bookmark with Feature Caching Enabled
Run the Revit Reader Feature Types bookmark with feature caching enabled. Ensure the Navigator pane is visible in the workspace (View → Windows → Navigator). From the Navigator pane, point the Revit reader’s Revit Project File parameter to the newly downloaded rac_basic_simle_project.rvt project file. Make sure feature caching is enabled in the Run menu. Now select the bookmark surrounding the various Revit reader feature types, and click the Run Just Contained option that pops up. 

SetUpTheReader.jpg

Inspect the various outputs in Visual Preview with Table View enabled. Note the presence of a variety of Revit element categories as individual reader feature types, as well as the naming convention of feature attributes shown in Table View.

Doors_AttributeNames.jpg

3. Run the Adjust Door Colors Bookmark
In this workspace, the goal is to adjust the color of interior and exterior doors. The Adjust Door Colors bookmark first uses a Tester transformer to split source door elements by their function, outputting two data streams: interior doors via the Passed port, and exterior doors via the Failed port. Each stream is passed through an AppearanceSetter transformer, where a color is applied to each input door feature. Interior doors will be colored light blue, while exterior doors will be colored navy blue. 

Select the Adjust Door Colors bookmark, and choose the Run To Contained icon that pops up. 

AdjustDoorColor.jpg


Once the translation completes, select the Output feature cache of each AppearanceSetter to view the color-adjusted door features in Visual Preview.

AdjustedDoors_VisualPreview.jpg
Feature caches of both AppearanceSetter transformers, rendered in the Graphics view of FME’s Visual Preview pane

4. Create a New Project File with the Revit Writer
Ensure that both the Navigator Pane and the Translation Log pane are visible. If either of these are not visible, they can be enabled from the View menu: View → Windows → Navigator or Translation Log. 

Access the Revit Project File parameter of the Revit writer in the Navigator Pane. Adjust its value to the desired file location and name of the to-be-written Revit project file. Now, take a look at the Template File parameter for this writer. Notice how its value points to the blank Architectural_Blank.rte Revit template file. All writer feature types will be written to this blank template file as Generic Models.  

Finally, select the Revit Writer With Blank Template bookmark, and click the Run Just Contained icon that pops up. Watch the messages that appear in the Translation Log pane as the writer performs its actions. One of the first messages that will appear after the initiation of the writer will indicate the version of Revit that the new project file has been written for.  

WriterInNavigator_v2.jpg

Note: several blue warning messages will appear in the Translation Log pane as features are written. This is intended for demonstration purposes, to highlight some of the warnings that may occur when writing with the Revit writer. Many of these warnings can be eliminated by including a GeometryValidator transformer just upstream of the writer.

5. View the Written Project File in FME Data Inspector
Once the Revit writer completes its translation, start FME Data Inspector 2023.0+. Choose Open Dataset from the Start Page. In the Select Dataset to View dialog, choose Autodesk Revit as the Format, and point the Dataset parameter to the newly written Revit project file. Click OK.

By default, the written elements will be displayed in a 2D view. Choose the 3D option from the toolbar ribbon of Data Inspector, and then orbit around the model to see the adjusted exterior door colors. Notice how all written elements now fall within the Generic Models category.

WrittenOutput_DI.jpg

Using the Select tool, click on one of the navy blue exterior doors. The Feature Information window will display, listing the written feature attributes for the selected door element.

DI_SelectADoor.jpg

Notice how the written door element has maintained the values for many of the source built-in parameters, but not all. Those values related to the former Architectural.Doors category are not maintained. This is expected, as these door elements now belong to the Generic Models category. 

6. View the Written Project File in Autodesk Revit
Start-up Autodesk Revit 2023+. From the start page which opens, choose Open… under the Models options at left. 

REvit_OpenModel.jpg

Point the Open dialog that pops up to the newly written Revit project file, and click Open. When the FME-written project file is opened in Autodesk Revit, a Foreign File warning message will appear. This warning message is expected, as the project file was not created in Autodesk Revit.

ForeignFileWarning.jpg

Choose “Continue opening the file” to view the written project. By default, the FME-written elements are rendered in a 2D view with a wireframe display.

Revit2023_Wireframe.jpg

To see the adjusted door colors, first create a 3D view by selecting the View tab, and then select 3D View from the Create panel. 

Revit2023_View3D.jpg

Next, access the Visual Style menu by selecting the 3D cube icon along the bottom of the main display. Choose the Shaded display option therein. 

Revit_GraphicDisplayOptions.jpg

Written elements will now be rendered with their set colors. Note the navy blue color of exterior doors, indicating that the door color adjustments made in FME Workbench have been successfully written by the Revit writer, and are displayed correctly in Autodesk Revit.

WrittenProjectFile_DoorsNavyBlue.jpg
Output project file from the Revit writer, as viewed in Autodesk Revit 2023
 

Additional Resources 

Autodesk Revit Reader / Writer Documentation
BIM Tutorial
Autodesk Revit 2023 Sample Files (non-FME link)


Data Attribution 

This document contains a hyperlink to and images of content from the Autodesk® Revit 2023® Help, available under a Creative Commons Attribution-NonCommercial-Share Alike license. Copyright © 2023 Autodesk, Inc.
 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.