Difference between revisions of "Revit setup for OpenBIM"

From Wiki.OSArch
m
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Revit does not come with strong official support for IFC. This guidebook relies on Revit users using the [https://github.com/Autodesk/revit-ifc revit-ifc] open-source Revit IFC plug-in.
+
{{warning|this page has not been audited for accuracy for Revit versions above 2018}}
  
* [https://apps.autodesk.com/RVT/en/Detail/Index?id=1763588736399554049&autostart=true Download revit-ifc 2019]
+
[[Autodesk Revit]] does not come with strong official support for [[Industry Foundation Classes (IFC)]]. This guidebook relies on [[Revit]] users using the [https://github.com/Autodesk/revit-ifc revit-ifc] open-source Revit IFC plug-in. Although the plug-in comes bundled with Revit, the bundled version is usually outdated and contains bugs that prevent basic functionality from working (such as the ability to assign IFC type parameters using the official shared parameters file, [https://github.com/Autodesk/revit-ifc/issues/217 bug report]). It is therefore a requirement for productive output to update to the latest version using the download links below.
 +
 
 +
* [https://apps.autodesk.com/RVT/en/Detail/Index?id=1763588736399554049 Download revit-ifc 2019]
 
* [https://apps.autodesk.com/RVT/en/Detail/Index?id=8986482933300179260 Download revit-ifc 2020]
 
* [https://apps.autodesk.com/RVT/en/Detail/Index?id=8986482933300179260 Download revit-ifc 2020]
 +
* [https://apps.autodesk.com/RVT/en/Detail/Index?id=7265544480016320144 Download revit-ifc 2021]
 +
There can be a delay between a new version being ready and appearing on apps.autodesk.com, the executables are first published in the [https://github.com/Autodesk/revit-ifc/releases revit-ifc github]
 +
 +
== Setting up IFC class mappings ==
 +
 +
Revit comes with a mappings file to map Revit family categories to IFC classes. OSArch has provided its own version of this file with the following improvements:
 +
 +
* Out of the box, Revit won't export grids to IFC. This fixes that, exporting grids appropriately to <code>IfcGrid</code>
 +
* Instead of being excluded from export, <code>Structural Connections</code> are now exported as <code>IfcMechanicalFastener</code> or <code>IfcFastener</code> as relevant.
 +
* <code>Topography</code> is exported as <code>IfcSite</code>, to allow for IFC2X3 geolocation to occur.
 +
* Structural holes are exported as <code>IfcOpeningElement</code> instead of being omitted.
 +
* Structural members are exported as <code>IfcMember</code> instead of <code>IfcBuildingElementProxy</code>, except for <code>Joist</code> objects, which are exported as <code>IfcBeam</code>.
 +
* Wall sweep walls are exported as <code>IfcWall</code> instead of <code>IfcBuildingElementProxy</code>.
 +
 +
You can download it here:
 +
 +
* [https://raw.githubusercontent.com/Moult/revit-ifc/osarch/Install/Program%20Files%20to%20Install/exportlayers-ifc-osarch.txt Revit and IFC class mapping]
 +
 +
It is important to ensure that class mapping are valid. Revit will not stop you from specifying invalid class mappings, such as mapping certain objects to be exported as <code>IfcSite</code> or <code>IfcGrid</code>. This will end up creating invalid IFC files which can cause problems in other software.
 +
 +
See also: [[IFC classes]]
 +
 +
== Setting up shared parameters ==
  
 
Simply installing the plug-in does not guarantee the quality of IFC exports and imports. Many parameters need to be manually created and export settings need to be manually written. To aid this procedure a shared parameters file is provided. This is similar to the shared parameters provided by Autodesk, with some additions to overcome shortcomings in the Autodesk version, in particular for geolocation and type vs instance parameter name clashes. Many of these parameters will be used throughout the guidebook.
 
Simply installing the plug-in does not guarantee the quality of IFC exports and imports. Many parameters need to be manually created and export settings need to be manually written. To aid this procedure a shared parameters file is provided. This is similar to the shared parameters provided by Autodesk, with some additions to overcome shortcomings in the Autodesk version, in particular for geolocation and type vs instance parameter name clashes. Many of these parameters will be used throughout the guidebook.
Line 10: Line 35:
 
[[File:Revit-setup-group.png|An example of IFC parameters in Revit]]
 
[[File:Revit-setup-group.png|An example of IFC parameters in Revit]]
  
You can download the OSArch Revit Shared Parameters [[File:Revit-sharedparams.txt]], which is based off the official Autodesk-provided shared parameters, but contains minor tweaks to accommodate for common Revit workarounds.
+
OSArch has prepared a Revit shared parameters files, shown below. They are based off the official Autodesk shared parameters, but contains a few improvements:
 +
 
 +
* IFC2X3 geolocation parameters are added
 +
* The deprecated parameter <code>IfcSiteGUID</code> has been removed, as the built-in parameter should be used instead.
 +
 
 +
You can download them here:
 +
 
 +
* [https://raw.githubusercontent.com/Moult/revit-ifc/osarch/Install/Program%20Files%20to%20Install/IFC%20Shared%20Parameters-RevitIFCBuiltIn_ALL.txt Shared parameters for instances]
 +
* [https://raw.githubusercontent.com/Moult/revit-ifc/osarch/Install/Program%20Files%20to%20Install/IFC%20Shared%20Parameters-RevitIFCBuiltIn-Type_ALL.txt Shared parameters for types]
 +
 
 +
== Setting up property set mappings ==
  
 
The Revit IFC exporter also requires the user to define property sets to be exported. By default, the definition is empty. A template is provided below.
 
The Revit IFC exporter also requires the user to define property sets to be exported. By default, the definition is empty. A template is provided below.
Line 47: Line 82:
 
# 1W_HslFTT2WwXj91DxSWxH
 
# 1W_HslFTT2WwXj91DxSWxH
 
</pre>
 
</pre>
 +
 +
== See also ==
 +
* [[OpenBIM]]
 +
* [[Autodesk Revit]]
 +
 +
==External References==
 +
 +
* buildingSMART Denmark have written an [https://anvisninger.molio.dk/Gratis-vaerktojer/buildingSMART/IFC_Export_Guide_EN IFC Export Guide for Revit and ArchiCAD]
 +
 +
[[Category:Autodesk Revit]]

Revision as of 19:58, 27 March 2021


Warning Warning: this page has not been audited for accuracy for Revit versions above 2018


Autodesk Revit does not come with strong official support for Industry Foundation Classes (IFC). This guidebook relies on Revit users using the revit-ifc open-source Revit IFC plug-in. Although the plug-in comes bundled with Revit, the bundled version is usually outdated and contains bugs that prevent basic functionality from working (such as the ability to assign IFC type parameters using the official shared parameters file, bug report). It is therefore a requirement for productive output to update to the latest version using the download links below.

There can be a delay between a new version being ready and appearing on apps.autodesk.com, the executables are first published in the revit-ifc github

Setting up IFC class mappings

Revit comes with a mappings file to map Revit family categories to IFC classes. OSArch has provided its own version of this file with the following improvements:

  • Out of the box, Revit won't export grids to IFC. This fixes that, exporting grids appropriately to IfcGrid
  • Instead of being excluded from export, Structural Connections are now exported as IfcMechanicalFastener or IfcFastener as relevant.
  • Topography is exported as IfcSite, to allow for IFC2X3 geolocation to occur.
  • Structural holes are exported as IfcOpeningElement instead of being omitted.
  • Structural members are exported as IfcMember instead of IfcBuildingElementProxy, except for Joist objects, which are exported as IfcBeam.
  • Wall sweep walls are exported as IfcWall instead of IfcBuildingElementProxy.

You can download it here:

It is important to ensure that class mapping are valid. Revit will not stop you from specifying invalid class mappings, such as mapping certain objects to be exported as IfcSite or IfcGrid. This will end up creating invalid IFC files which can cause problems in other software.

See also: IFC classes

Setting up shared parameters

Simply installing the plug-in does not guarantee the quality of IFC exports and imports. Many parameters need to be manually created and export settings need to be manually written. To aid this procedure a shared parameters file is provided. This is similar to the shared parameters provided by Autodesk, with some additions to overcome shortcomings in the Autodesk version, in particular for geolocation and type vs instance parameter name clashes. Many of these parameters will be used throughout the guidebook.

Whenever one of these shared parameters are used, they must belong to the IFC Parameters group, as shown below.

An example of IFC parameters in Revit

OSArch has prepared a Revit shared parameters files, shown below. They are based off the official Autodesk shared parameters, but contains a few improvements:

  • IFC2X3 geolocation parameters are added
  • The deprecated parameter IfcSiteGUID has been removed, as the built-in parameter should be used instead.

You can download them here:

Setting up property set mappings

The Revit IFC exporter also requires the user to define property sets to be exported. By default, the definition is empty. A template is provided below.

Setting up psets in Revit

A starting template for Revit user defined psets can be found here: File:Revit-psets.txt

Revit and IFC GlobalId attributes

IFC GlobalId values are not visible in Revit by default. This becomes problematic if users are trying to reference an object by its ID. The only way to see the GlobalId is to export your Revit model to an IFC file with the Store the IFC GUID in an element parameter after export option enabled in File > Export > IFC > Modify Setup > Advanced window, as shown below. It is highly recommended that this option is always enabled.

Revit-settings-ifcglobalid.PNG

After your export is complete, you can now see a new parameter called IfcGUID for your objects as shown below. Despite the inconsistent naming, this is actually the IFC GlobalId. This property can now be overridden, copied, or searched for. If the text is deleted, it will be rewritten on your next export. However, it will always rewrite the original GlobalId, as it is predetermined inside Revit. There is no way to regenerate a fresh ID for an existing Revit object.

Revit-params-ifcglobalid.png

It is possible to determine the IFC GlobalId without the overhead of exporting a full IFC file, since it is predetermined. Every Revit element has a UniqueId parameter, which is a hexademical string formatted in groups of 8-4-4-4-12-8. This string contains 8 more hexadecimal characters at the end compared to the standard UUID formatting. These 8 trailing hexadecimal characters store the Revit ElementId. The remaining standard UUID formatted string is called the Revit EpisodeId, which provides true uniqueness, as the Revit ElementId has no guarantee of uniqueness.

ElementId = 130315 (Decimal) or 1fd0b (Hex)
           < ........... EpisodeId .......... >-<ElmtId>
UniqueId = 60f91daf-3dd7-4283-a86d-24137b73f3da-0001fd0b

This UniqueId can be converted into an IFC GUID by XOR-ing the last 8 characters of the EpisodeId and the 8 character ElementId. This provides an IFC GUID in standard UUID format. Revit calls this standard UUID format the "DWF GUID" for historical reasons, but it contains the same data as the IFC GUID. It may then be compressed to the 22-character IFC base64 GlobalId attribute.

Example Python code of this procedure is shown below.

unique_id = UniqueId.replace('-', '')
dwf_guid = unique_id[0:-16] + hex(int(unique_id[-16:-8], 16) ^ int(unique_id[-8:], 16))[2:]
# 60f91daf3dd74283a86d24137b720ed1
ifc_guid = ifcopenshell.guid.compress(dwf_guid)
# 1W_HslFTT2WwXj91DxSWxH

See also

External References