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:

  1. Right-click the model in the project explorer and select Add Maths Script.

  2. Evolution will create a script object in the project explorer under the block model. Double-click this object to open the script window in the viewer.
  3. Write the required script.

    • View the existing properties of the model by typing block followed by a full stop.

    • Modify the existing properties of the model by typing in the attribute name on the left, followed by an expression on the right.

      existingAttribute = block.X + block.Y

    • Create temporary attributes (that will not be written to the model and will only be used within the script) by wrapping the expression on the right-hand side inside a define function.

      tempAttribute = define(block.X + block.Y)

  4. Click Run formula.
  5. Check that the new attribute has been calculated correctly by opening the block model in the viewer and checking its properties.