...
Creating a custom variable
Go to Setup > Block Model > Edit > Reservable Model Generator.
Click Custom Variables to open the script editor.
Clear all text from the code editor.
Replace it with the sample code below.
...
Dry Tonnes
Code Block | ||
---|---|---|
| ||
using System; using System.Collections.Generic; using System.Text; using System.Linq; using Alastri.Scripting; using Alastri.BlockModel.Engine.CustomVariables; public class DryTonnes : IDoubleCustomVariable { public double GetNumber(CustomVariablesContext context) { double density = context.N("DENSITY"); double volume = context.N("XINC")*context.N("YINC")*context.N("ZINC"); return (density > 0 ? density * volume : 0); } } |
...