Difference between revisions of "Revit setup for OpenBIM/Revit and IFC classes"

From Wiki.OSArch
Line 5: Line 5:
 
=Export=
 
=Export=
  
Revit follows a series of convoluted rules to determine what IFC class an object is exported as. If one rule cannot be satisfied, it moves on to the next rule until it finds a suitable IFC class.
+
Revit follows a series of convoluted rules to determine what IFC class an object is exported as. If one rule cannot be satisfied, it moves on to the next rule until it finds a suitable IFC class. Strap on your seat belts, because this is going to do your head in.
  
 
==Rule 1: Hardcoded IFC export classes==
 
==Rule 1: Hardcoded IFC export classes==
Line 139: Line 139:
 
==Rule 2: Check for a manually overridden instance parameter ==
 
==Rule 2: Check for a manually overridden instance parameter ==
  
The IFC export class can be overridden on a per instance basis. To do this, parameters need to be created and assigned to instances. A shared parameter file with these parameters is provided in the [[Revit setup]] page.
+
The IFC export class can be overridden on a per instance basis. To do this, parameters need to be created and assigned to instances. A shared parameter file with these parameters is provided in the [[Revit setup]] page. If none of these parameters are present, proceed to rule 3.
  
When the IFC class is overridden at an instance level, this additionally overrides the IFC type object that the IFC element is assigned to.
+
When the IFC class is overridden at an instance level, this additionally overrides the IFC type object that the IFC element is assigned to. For example, if your Revit category is <code>Structural Columns</code>, but override a column instance to be an <code>IfcWall</code>, Revit will also automatically create a corresponding <code>IfcWallType</code> with the column type information. It is not possible to control the IFC class of the corresponding IFC type object.
 +
 
 +
When a predefined type is defined, it should be noted that it will set the predefined type on the corresponding IFC type object, not the IFC object itself. For example, if you set a predefined type of <code>PLUMBINGWALL</code>, that value will get assigned to the <code>IfcWallType</code>, not the <code>IfcWall</code>. This means that if you have two instances with two different predefined types belonging to one Revit family and same Revit type, Revit will still create two IFC type objects in IFC. It is not possible to control this, and will likely lead to broken type and element relationships in schedules, as well as unnecessarily duplicated information.
  
 
{|class="wikitable"
 
{|class="wikitable"
Line 154: Line 156:
 
| <code>IfcType</code>
 
| <code>IfcType</code>
 
| Instance
 
| Instance
| '''Note: this is deprecated and should not be used.''' This may be filled out with the desired predefined type (e.g. <code>PLUMBINGWALL</code>). This text is case insensitive, but it is recommended for neatness to use ALLCAPS as per the IFC documentation. If a predefined type is specified both in the <code>IfcType</code> parameter as well as in the <code>IfcExportAs</code> parameter (via joining with the dot symbol), then the <code>IfcType</code> takes priority. Therefore, it is advised to generally not use the dot notation, and keep the two values separated.
+
| '''Note: this is deprecated and should not be used.''' Despite being deprecated, Autodesk still ships this in their shared parameters file, and so we have chosen to document its usage here. This may be filled out with the desired predefined type (e.g. <code>PLUMBINGWALL</code>). This text is case insensitive, but it is recommended for neatness to use ALLCAPS as per the IFC documentation. If a predefined type is specified both in the <code>IfcType</code> parameter as well as in the <code>IfcExportAs</code> parameter (via joining with the dot symbol), then the <code>IfcType</code> takes priority. Therefore, it is advised to generally not use the dot notation, and keep the two values separated.
 
|-
 
|-
 
| <code>IfcExportType</code>
 
| <code>IfcExportType</code>
Line 163: Line 165:
 
==Rule 3: Check for a manually overridden type parameter ==
 
==Rule 3: Check for a manually overridden type parameter ==
  
Instead of overriding a single instance, it may be more advisable to override by type. All instances of that type will then be overridden too. For example, if a type is overridden to be <code>IfcWallType</code>, each instance will be overridden automatically to be <code>IfcWall</code>. The approach is similar, except that the parameters must be type parameters, and are called <code>IfcExportAs[Type]</code> and <code>IfcExportType[Type]</code> instead respectively. The parameter must be filled out with the name of the IFC type class (e.g. <code>IfcWallType</code>).
+
You can also override by Revit type. Note that the parameters below only work if you are using a recent version of the exporter, so please update as recommended in the [[Revit setup]], as some out of the box exporters have a bug which prevent these parameters from working. If none of these parameters exist, proceed to rule 4.
  
 
If the project is based on IFC2X3, it is advisable to override by type, as IFC2X3 contains more granular IFC classes for element types, especially in regards to MEP disciplines.
 
If the project is based on IFC2X3, it is advisable to override by type, as IFC2X3 contains more granular IFC classes for element types, especially in regards to MEP disciplines.
  
==Rule 2: Check IFC class mappings table==
+
Similar to how manually overriding instance parameters will cause a corresponding IFC type object to be generated, manually overriding type parameters will also change all instances. For example, if a type is overridden to be an <code>IfcWallType</code>, all instances will turn into <code>IfcWall</code>. For this reason it is generally advised to override by type prior to overriding by instance.
 +
 
 +
{|class="wikitable"
 +
! Parameter Name
 +
! Parameter Type
 +
! Notes
 +
|-
 +
| <code>IfcExportAs[Type]</code>
 +
| Type
 +
| See rules for manually overridden instance parameters in Rule 2.
 +
|-
 +
| <code>IfcType[Type]</code>
 +
| Type
 +
| See rules for manually overridden instance parameters in Rule 2.
 +
|-
 +
| <code>IfcExportType[Type]</code>
 +
| Type
 +
| See rules for manually overridden instance parameters in Rule 2.
 +
|}
 +
 
 +
==Rule 4: Check IFC class mappings table==
  
 
Revit offers a mapping table from Revit category (and subcategory) to IFC class and IFC Predefined Type. You can manually access this by going to <code>File > Export > Options > IFC Options</code>. You can save and load these settings.
 
Revit offers a mapping table from Revit category (and subcategory) to IFC class and IFC Predefined Type. You can manually access this by going to <code>File > Export > Options > IFC Options</code>. You can save and load these settings.
Line 182: Line 204:
  
 
=Import=
 
=Import=
 +
 +
[[Category:Autodesk Revit]]

Revision as of 00:23, 11 September 2020

It is possible to control which IFC classes map to which Revit objects when exporting and importing to some degree. Prior to reading this, it is important to first read the resources provided in Revit setup.

To set IFC classes and predefined types in Revit, it requires intimate knowledge of all of the IFC class names, which ones can be used (i.e. which ones are not abstract), and all of the predefined types possible. Revit does not provide any interface or drop downs or lists that aid selection. Therefore, if you make a spelling mistake, or accidentally type extra characters, the export will also be incorrect. It may be useful to use the BlenderBIM Add-on IFC class search website to discover which IFC classes should be used.

Export

Revit follows a series of convoluted rules to determine what IFC class an object is exported as. If one rule cannot be satisfied, it moves on to the next rule until it finds a suitable IFC class. Strap on your seat belts, because this is going to do your head in.

Rule 1: Hardcoded IFC export classes

Revit has a series of hardcoded IFC export classes depending on the type of Revit object. It is not possible to override this in any way, and users are required to remodel the object using another method if they wish to get correct OpenBIM output. The table below describes the internal type of Revit object, and how it is exported. If you are unsure what this internal type is, this can be checked in the Revit API documentation (note: this requires some programming background knowledge to understand). If your object is not part of the table below, proceed to rule 2.

Revit Category IFC Class Notes
Area Scheme
Assembly Instance
Beam System
Ceiling
Ceiling and Floor
Wall Foundation
Curve Element
Curtain System
Duct Insulation
Duct Lining
Electrical System
Fabric Area
Fabric Sheet
Face Wall
Filled Region
Grid
Group
Hosted Sweep
Part
Pipe Insulation
Railing
Ramp
Rebar
Rebar Coupler
Roof Base
Spatial Element
Stairs
Text Note
Topography Surface
Truss

Rule 2: Check for a manually overridden instance parameter

The IFC export class can be overridden on a per instance basis. To do this, parameters need to be created and assigned to instances. A shared parameter file with these parameters is provided in the Revit setup page. If none of these parameters are present, proceed to rule 3.

When the IFC class is overridden at an instance level, this additionally overrides the IFC type object that the IFC element is assigned to. For example, if your Revit category is Structural Columns, but override a column instance to be an IfcWall, Revit will also automatically create a corresponding IfcWallType with the column type information. It is not possible to control the IFC class of the corresponding IFC type object.

When a predefined type is defined, it should be noted that it will set the predefined type on the corresponding IFC type object, not the IFC object itself. For example, if you set a predefined type of PLUMBINGWALL, that value will get assigned to the IfcWallType, not the IfcWall. This means that if you have two instances with two different predefined types belonging to one Revit family and same Revit type, Revit will still create two IFC type objects in IFC. It is not possible to control this, and will likely lead to broken type and element relationships in schedules, as well as unnecessarily duplicated information.

Parameter Name Parameter Type Notes
IfcExportAs Instance This may be filled out in two ways, either just the desired IFC export class (e.g. IfcWall) or the IFC export class and the predefined type joined with the dot symbol (e.g. IfcWall.PLUMBINGWALL). This text is case insensitive, but it is recommended for neatness to follow the conventions in the IFC documentation, where the classes use CapsCase and the predefined type uses ALLCAPS.
IfcType Instance Note: this is deprecated and should not be used. Despite being deprecated, Autodesk still ships this in their shared parameters file, and so we have chosen to document its usage here. This may be filled out with the desired predefined type (e.g. PLUMBINGWALL). This text is case insensitive, but it is recommended for neatness to use ALLCAPS as per the IFC documentation. If a predefined type is specified both in the IfcType parameter as well as in the IfcExportAs parameter (via joining with the dot symbol), then the IfcType takes priority. Therefore, it is advised to generally not use the dot notation, and keep the two values separated.
IfcExportType Instance Note: this should be used instead of IfcType. This may be filled out with the desired predefined type (e.g. PLUMBINGWALL). This text is case insensitive, but it is recommended for neatness to use ALLCAPS as per the IFC documentation. If a predefined type is specified in all three possible parameters, i.e. the IfcExportType parameter, the IfcType parameter as well as in the IfcExportAs parameter (via joining with the dot symbol), then the IfcExportType takes priority over the other two. Therefore, it is advised to generally not use the dot notation, and keep the two values separated. It also advised to avoid IfcType completely to prevent user confusion.

Rule 3: Check for a manually overridden type parameter

You can also override by Revit type. Note that the parameters below only work if you are using a recent version of the exporter, so please update as recommended in the Revit setup, as some out of the box exporters have a bug which prevent these parameters from working. If none of these parameters exist, proceed to rule 4.

If the project is based on IFC2X3, it is advisable to override by type, as IFC2X3 contains more granular IFC classes for element types, especially in regards to MEP disciplines.

Similar to how manually overriding instance parameters will cause a corresponding IFC type object to be generated, manually overriding type parameters will also change all instances. For example, if a type is overridden to be an IfcWallType, all instances will turn into IfcWall. For this reason it is generally advised to override by type prior to overriding by instance.

Parameter Name Parameter Type Notes
IfcExportAs[Type] Type See rules for manually overridden instance parameters in Rule 2.
IfcType[Type] Type See rules for manually overridden instance parameters in Rule 2.
IfcExportType[Type] Type See rules for manually overridden instance parameters in Rule 2.

Rule 4: Check IFC class mappings table

Revit offers a mapping table from Revit category (and subcategory) to IFC class and IFC Predefined Type. You can manually access this by going to File > Export > Options > IFC Options. You can save and load these settings.

Out of the box, there are many shortcomings to the IFC class mappings table. OSArch provides an improved default set of IFC class mappings in the Revit setup page, and describes what the improvements are.

Rule 3: Check if it is part of a furniture group

If the element is contained within a Revit group that is an IfcFurniture, it is always exported into an IfcSystemFurnitureElement.

==Rule 4:

  1. ... unless the particular Revit family is one of the series of hardcoded types that cannot be overridden no matter what.


Import