We can use expressions in the template strings that are used to display text on Annotations and Bill columns.

This allows us to make the resulting text very flexible by using calculations on the variables such as + - / * and also the IF statement to make the string different based on a condition of the part.

These expressions are implemented in a limited way (in version 9) so only the expressions and functions mentioned here can be used.

The expressions and functions should be used within %% to tell Parabuild that the text should be evaluated. All other text strings without %% surrounding them will be left as is.


Expressions and functions

These are the supported expressions and functions :

  • When %[...]% is used, then the text between brackets is evaluated as an expression, and the result must be a string
  • When %(...)% is used, then the text between brackets is evaluated as an expression, and the result must be a number
  • The function %if(A,B,C)% is supported : 
    • In the first fields before the first , (A) we should enter the condition. Parabuild is expecting a 0 or 1 as value in this condition. Values higher than 0 are considered as a '1'. You could use fixed Parabuild queries that contain a _ in their name such as is_bolt or classify_beam, and we can also use operators < > = in this condition. In version 9 we can't yet use all the properties, variables or filters in this condition field.
    • In the second field after the first , (B) we should enter the text that should be returned when the condition is true between '' single quotes. This can be a fixed text or any property, variable or filter between %%.
    • In the third field after the second , (C) we should enter the text that should be returned when the condition is false between '' single quotes. This can be a fixed text or any property, variable or filter between %%.
  • The function %YesOrNo()% is supported. Within the brackets a condition should be entered. This will return the text 'Yes' when the condition result is true, and otherwise it will return 'No'


Conditions

The following functions can be used without %% but only within conditions of the %if(,,)% and %YesOrNo()% functions : 

  • & between 2 conditions as AND operator : this tells Parabuild that both conditions should be true to make the overall condition true.
  • | between 2 conditions as OR operator : this tells Parabuild that one of the conditions can be true to make the overall condition true.
  • The following geometric calculation functions are also supported inside a condition : sin(), cos(), tan(), ason(), acos(), atan(), sqrt(), log(), log10(), abs(), sign(), int(), frac(), dtr(), and rtd(). These mathematical functions are explained in the macro variables topic. 
  • The function not() is supported for inverting the result inside a condition.

These special condition functions should be used without %% because expression evaluation is already being assumed within the brackets of the if() statement.


Examples

Here are some examples for all of the above functions and statements : 

  • %(%PbColMarkWeight%*2)%
    This will double the actual weight of the complete assembly.
  • %YesOrNo(%is_bolt% & not(%shop_bolt%))%
    This will return Yes when the part is a field bolt, and No when the part is a shop bolt or any other part.
  • %if((%is_bolt% & not(%shop_bolt%)), 'Site bolt', 'Something else')%
    This will return Site bolt when the part is a field bolt, and Something else when the part is a shop bolt or any other part.
  • %if(%classify_column%,'%ClosestGridX%-%ClosestGridY%','%ClosestGrid%')%
    This could return 4-B for a column, and B for all other profiles.