In this example, we will use an Option within a Model Calculation to control the formatting of a Component Description.
We’ll be using the Component Model within the North America Metric Configuration Pack for this example (see ‘Geological Descriptions’ section here).
A Component Description breaks the description down into multiple headers (fields) for each term within the Description. An expression in the Description header takes the terms from the separate headers and builds them into a final Description.
For this example, we will add a Project Option that can be used to hide the USCS code within the Description.
First, we’ll add a ‘HideUSCSInDescription’ Option header in a ProjectOption group with a Boolean Data Type.
We will need to edit the Calculation expression for the Description header in the Field Geological Descriptions (StratumDetails) group.
We’ll edit this line within the long expression:
And update it to reference the Project Option with this block of expression:
if( isblank([ProjectOptions.HideUSCSInDescription]), if(isblank([StratumDetails.USCS]),'','('+[StratumDetails.USCS]+')'), if([ProjectOptions.HideUSCSInDescription],'','('+[StratumDetails.USCS]+')') )
We’ll then test and see how this works…
If we set the Project Option to ‘No’, we see the USCS codes are included in the Descriptions:
Note – You may need to reprocess the calculations under Project>Reprocess Calculations and reload the data under Grid Tools>Reload Data to see the changes.
If we set the Project Option to ‘Yes’, we see the USCS codes are hidden in the Descriptions:
Note – As above, you may need to reprocess the calculations under Project>Reprocess Calculations and reload the data under Grid Tools>Reload Data.
There are many potential variations and use cases for how Options can be used with Model Calculations.