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 go to Display panel, Block Models section. Press gear icon located on the right from Constraints dropdown.

  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. Double click in the Available Formulas for code hints.

  6. Press OK to finish.

Configure Constraints dialog

7. In the Block Model panel on the right, toggle eye icon to show blocks and from the Constraints dropdown select the blocks shading you have created (Note that custom shadings are shown in bold orange, while standard shadings are shown in normal black).

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