RR Block Model Custom Constraints

Constraints may be used to hide parts of the block model based on some criteria, such as material type or grade threshold.

To add a new constraint:

  1. In Designer tab > Display panel > Block Models section > Constraints dropdown > gear icon.

  2. Click the blue plus icon to add a new constraint.

  3. Rename the label to "HG Only".

  4. Paste the sample formula into the code editor.

  5. Press OK to finish.

Double click in the Available Formulas for code hints.

HG only blocks example

Show only HG
using System; using System.Collections.Generic; using System.Text; using System.Linq; using Alastri.RR.Ui; using Alastri.RR.Service; public class CustomBlockConstraint : IBlockConstraint { public bool IsVisible(BlockContext context) { if (context.T("Parcel") == "hg") { return true ; } return false ; } }
Show specific materials
using System; using System.Collections.Generic; using System.Text; using System.Linq; using Alastri.RR.Ui; using Alastri.RR.Service; public class CustomBlockConstraint : IBlockConstraint { public bool IsVisible(BlockContext context) { if (context.T("Parcel") == "hg" || context.T("Parcel") == "mg") { return true ; } return false ; } }
Filter by Fe
using System; using System.Collections.Generic; using System.Text; using System.Linq; using Alastri.RR.Ui; using Alastri.RR.Service; public class CustomBlockConstraint : IBlockConstraint { public bool IsVisible(BlockContext context) { if (context.N("DryTonnes.FE") >= 57.5) { return true; } return false; } }
Filter by Fe and Al