11.02.2025 • C3D Modeler

String Expressions in Renga: Brining BIM Automation to a New Level

Renga is a comprehensive BIM system based on the C3D Modeler geometric kernel. The system's object properties are highly important. They are used in BOMs and legends, marker styles, filters, and many other scenarios.

Last year, the Renga team introduced the support for string expressions in expression-defined object properties. This opens up new opportunities for design automation and flexible model parameterization.

Renga used to support equations with real arguments in expression-defined object properties. Once we added the MbTreeStringVariable class to C3D Modeler, you can use string arguments in the expressions. The Renga team suggested this improvement. Its implementation is a major milestone in expanding the product functionality.

With MbTreeStringVariable you can:

  • Compare variables to strings
  • Assign string values
  • Perform comparisons (equality and inequality) with string variables and string constants.

Let us take a look at a typical expression in Renga. It makes a property of the Area data type dependent on the room name:

Room name == 'Balcony' ? Net floor area * 0.5 : Room name == 'Balcony' || Room name == 'Terrace' ? Net floor area * 0.3 : Net floor area

This expression applies the reduction coefficients for each room to calculate the net floor area of the residence:

  • If the room name is Balcony, the area is a half of the net floor area.
  • If the room name is either Balcony or Terrace, the area is one-third of the net floor area.
  • In all other cases, the area is equal to the net floor area.
String Expressions in Renga: Brining BIM Automation to a New Level, photo 1
Example: an expression-defined property with string arguments in Renga

Dmitry Kirillov, a C3D Modeler team member, comments

Dmitry Kirillov, a C3D Modeler team member, comments:

"At the request of the Renga team, we have added the support for string type variables (MbTreeStringVariable) to C3D Modeler. Such variables are useful in comparisons (equality and inequality) with other string variables or string constants.

For example, for two string variables MbTreeStringVariable var1("v1", "str1") and MbTreeStringVariable var2("v2", "str2"), the expression "v1 == v2" is zero because str1 is not equal to str2. Comparisons with string constants are similar. For example, the expression "v1 == 'str1'" is one because the value of the variable v1 is "str1".

String variables can be used in the conditional (ternary) statement both in the conditions and expressions. A ternary operator can return both strings and real numbers. For example, the expression "v1 == 'str2'? 1.0 : 2.0" would be 2.0. The string value of the expression "10.0 > 5.0 ? v1 : v2" is "str1".

A ternary operator can be nested. For example, the expression "v1 == 'v2'? (v1 != v2 ? v1 : v2) : v2" returns "str2".

With string variables, you can automate many design procedures:

  • Intelligent filters for BOMs and legends
  • Auto assignment of object property values based on text attributes
  • More complex, flexible conditions for expression-defined parameters.

Close collaboration with the C3D Modeler team has enabled Renga to introduce the support for string variables and expand the software's intelligent data handling capabilities. The BIM platform is under continuous development to meet the needs of every user.

Share
Up