Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Press the gear icon on the right from Text dropdown.

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

  3. Rename the label to "Ore Tonnes".

  4. Paste the sample formula into the code editor.

  5. Double click in the Available Formulas for code hints.

  6. Press OK to finish.

...

Image Added

Multi-Line Label
Code Block
languagec#
using System;
using Alastri.RR.Ui;
using Alastri.RR.Service;

public class LabelFormat : ILabel
{         
    public string GetLabel(ShadingContext context)
    {
        return "Blast " + context.GetLevelName("Solid") + "\n"
		+ context.GetReserveValue("Volume").ToString("#,##0") + " bcm \n"
		+ context.GetReserveValue("DryTonnes").ToString("#,##0") + "t";
    }
}

...

Code Block
languagec#
using System;
using System.Collections.Generic;
using System.Linq;
using Alastri.RR.Ui;
using Alastri.RR.Service;

public class LabelFormat : ILabel
{   
    public string GetLabel(ShadingContext context)
    {
    List<string> temp = context.GetParcels();
	List<string> parcels = temp.ConvertAll(low => contextlow.GetParcelsToLowerInvariant());
	List<string> ores = new List<string>(){ "hg", "mg", "lg" };
		
	double oreTonnes = 0;
		
	foreach(var parcel in parcels)
	{
		if(ores.Any(ore => parcel.StartsWith(ore)))
		{
			oreTonnes += context.GetReserveValue("DryTonnes", parcel);
		}
	}
		
	return oreTonnes.ToString("#,##0");
    }
}

...