Skip to content

Revit IfcExporter parameter expression

WawanSolihin edited this page Dec 16, 2022 · 2 revisions

Revit IfcExporter parameter expression

New feature starting from 18.3.2

User can assign a simple expression to a parameter value in Revit that will be translated into the actual value during IFC export process. The purpose of this parameter expression is to allow dynamic reference to another parameter's value without making a duplicate copy.

The parameter must be defined as a text parameter. The export will determine what expected data type in the designated property for the parameter if defined, e.g. pre-defined property in a propertyset can be detected. If not, the default will be a string datatype.

Syntax:

   { *expr* }, or
   U{ *expr* }	- for unique value for the entire model for the same property. The system will append a running number in a round bracket. For example: "My Parameter", "My Parameter (2)", "My Parameter (3)", etc.

The "expr" can refer to another parameter on the same instance of its type:

  • expr on the same instance: {$this("")} For example: {$this("Height Offset From Level"}
  • expr on the type: {$type("")} For example: {$type("Fire Rating")}

if a parameter value is an elementid, the expr can be extended to follow the element's parameter. It is allowed only for one level. For example: expr for the name of the level where the object is located. For example: {$this("Level").("Name")}

Special predefined names:

  1. Object's element id: {$ElementId}
  2. Running number (valid for the same parameter of that category): #. For example: {"Layer " + #}
  3. Running number (valid only for the instance): ##. For example: {"Layer " + ##}

Simple arithmetic operations:

Simple arithmatic operations are supported for expr:

  1. Unary operator: "+" or "-". For example: {- $this("Height")}

  2. Multiplication, division, addition and subtraction: "*", "/", "+", "-" For example: {$this("Elevation") - 10.0} {$this("Height") * $this("Width')} The operators work only for number datatype, except for "+" that can be used to combine string. The resulting value will be converted whenever possible to the destination datatype. If it does not match and it is type of string, it will be converted to string. If the datatype is unknown, it will be created as a string datatype. Otherwise it will be an error. Combination of a number and a string will always result in a string. Another example: {$type("Mark") + "-" + $this("Mark") + " " + #}

  3. Power operation: in format (a)^2 or (a)^-2 For example: {($this("Width"))^2

Tips:

  1. Assigning parameter expression to a parameter may be a little repetitive if the same expression is to be used by many objects. To improve the process assigning the parameter expression, one may use a global variable, for example:
    • Create a global parameter (for example IfcNameExpr)

    • Assign the expression to the global parameter (e.g. IfcNameExpr)

      image

    • Assign the expression to IfcName of the object by simply selecting the global parameter

      image

    • Sample output in the IFC file:

      image

Clone this wiki locally