Applying a Maths Script
Source file: howto-how-to-apply-maths-script-on-block-model.htm
Blocks can be modified by performing mathematical operations on them using Evolution's maths script tool.
To apply a maths script on a block model:
-
Right-click the model in the project explorer and select the Add new maths script option.
- A script will be created in the project explorer under the block model. Double click this object to open the Maths Script window in the viewer.
-
Write a script.
-
Existing properties of the model can be read by typing "block" followed by a full stop.
-
Existing properties of the model can be modified by typing in the attribute name on the left, followed by an expression on the right.
existingAttribute = block.X + block.Y
-
Temporary attributes which will not be written to the model and only used within the script can be created by wrapping the expression on the right-hand side inside a define function.
tempAttribute = define(block.X + block.Y)
-
- Click Run formula.
- Check that the new attribute has been calculated correctly by opening the block model in the viewer and checking its properties.