All recipes can define a rule to automatically bind it to target elements – refer to item 4a in the illustration of section 4.2 for Measurement Recipes. The rule is an expression which is true for the target elements. If the target is any element of a wall type, the expression would be:
element.type = “Wall”
Conversely, if we wanted everything that was not a wall type:
not(element.type = “Wall”)
There can be multiple conditions in the rule joined with “and” or “or”. If, for example, drainage services are represented by elements that are:
-
of a wall type wall or a beam type
-
…and its ID contains the text “pipe”
…we could write this as:
(element.type = “Wall” or element.type = “Beam”) and element.id contains “pipe”
Note that the check for a wall or beam are enclosed in parentheses – this means it will be checked first, i.e. before looking at anything outside the parentheses. The rule would still be accepted without them, but the meaning is ambiguous – another possible meaning is the elements are:
-
of a wall type
-
…or of a beam type and its ID contains “pipe”
…which would target all walls and any beam with any ID containing “pipe”. A useful guideline is that you only need parentheses if the expression combines both “and” and “or”, and put them around any conditions containing “and”.
Comments
0 comments
Please sign in to leave a comment.