You can add different strings of logic to your Configuration Model when using formulas. The first formula we are going to look at are the OR and AND formulas. With these, you can add multiple conditions to a Configuration Model. We are going to work with the Configuration Model that we have made in the introduction.
OR and AND formulas
The OR and AND formulas are not in the autofill function of the formula editor. For this reason, this is a commonly overlooked function.
Context
You sell different Boat models. One of those is the Maria Model tugboat. This model has 3 specific sub Models. Model 1, 2 and 3. It is also possible to add extra options to your tugboat. Options like a GMDSS system and a 3 axis Controller. But when you have selected a big enough model of the tugboat, you can unlock an extra option: A second radar in addition to the first Radar.
We are going to implement both a OR and AND formula into the configurator. Below you will find the description on how to add these.
ORFormula
The extra options are only available with model 2 and 3 because of the size tugboat So we are going to set a condition to make the Extra options popup if only Model 2 or 3 are selected. To do this you can follow the steps below:

Open Elfsquad

Go to the Configuration Model you’ve created in the first lesson

Click on the Condition Constraint behind the Extra options Feature

Click on 'Add new Condition'. The formula editor now opens

Click on add variable and select 'Model 2' and 'Model 3'
We are going to add some logic now. We’re going to specify that one of both has to be selected during configuration to show the extra options. As we learned in the basics training you do this by using a 1 or a 0.

<>0 stands for activated

=0stand for not activated
So, the formula should look like this.
@model2 <> 0 OR @model3 <>0
You now specified that if Model 2 or Model 3 is selected the extra options become visible.
ANDFormula
Under the extra options are 4 possible addons for your tugboat. But the second Radar can only be available when the Radar and the GMDSS System are selected. You do this by following the steps below:

Click on the Conditions Constraint behind the Second Radar node

Click on add new condition

Click on add variable and add the GMDSS System and the Radar Feature

The formula is nearly identical to the OR formula, but you use an AND instead of the OR. This will look like this: @GMDSSSystem = 1 AND @Radar = 1+
You now specified that both these Features have to be selected to show the second radar option.
Comments
0 comments
Please sign in to leave a comment.