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:
In Designer tab > Display panel > Block Models section > Constraints dropdown > gear icon.
Click the blue plus icon to add a new constraint.
Rename the label to "HG Only".
Paste the sample formula into the code editor.
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
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 && context.N("DryTonnes.AL") >= 1.0) { return true; } return false; } }