Tip |
---|
In the Network tab in the Display panel locate Label field and press its dropdown: there is a preloaded list of preconfigured labels for Segments, Blocks, Nodes and Joins. We can add to this list by configuring custom labels. Find below examples of some custom labels. |
Table of Contents |
---|
Adding Custom Label
Press the gear icon on the right from the Label dropdown.
Click the blue plus icon to add a new label.
Rename the label as desired.
Paste the sample formula into the code editor window.
Double-click in the Available Formulas for code hints.
Press OK to finish.
Select the newly added label from the Label: field dropdown.
To view the label, make sure you the Labels eye toggle is enabled.
Tip |
---|
Note, that you can change label’s colors and alignments by pressing the Aa button on the right. |
Segments Distance Label
Code Block | ||
---|---|---|
| ||
using System; using Alastri.HaulInfinity.ScriptExtensions.Shading; public class CustomLabel : ISegmentLabel { public string GetLabel(ISegmentShadingContext context) { return (context.Distance).ToString("#,##0.00") + " m"; } } |
Segments Gradient Label
Code Block | ||
---|---|---|
| ||
using System;
using Alastri.HaulInfinity.ScriptExtensions.Shading;
public class CustomLabel : ISegmentLabel
{
public string GetLabel(ISegmentShadingContext context)
{
return (context.GradePct).ToString("#,##0.00") + "%";
}
} |
Segments Custom Property
Code Block | ||
---|---|---|
| ||
using System;
using Alastri.HaulInfinity.ScriptExtensions.Shading;
public class CustomLabel : ISegmentLabel
{
public string GetLabel(ISegmentShadingContext context)
{
return (context.GetCustomProperty("Region"));
}
} |
Blocks Name
Code Block |
---|
using System;
using Alastri.HaulInfinity.ScriptExtensions.Shading;
public class CustomLabel : IBlockLabel
{
public string GetLabel(IBlockShadingContext context)
{
string name = context.FullName;
string[] nameParts = name.Split('\\');
if(nameParts.Length <5) return "";
string pitName= nameParts[2];
string benchName= nameParts[4];
string blastName= nameParts[5];
return string.Concat(pitName,'-',benchName,'-',blastName);
}
} |
Blocks Auto Joins Number
Code Block |
---|
using System; using Alastri.HaulInfinity.ScriptExtensions.Shading; public class CustomLabel : IBlockLabel { public string GetLabel(IBlockShadingContext context) { return (context.AutoJoinCount).ToString(); } } |
Nodes Data Source
Code Block | ||
---|---|---|
| ||
using System; using Alastri.HaulInfinity.ScriptExtensions.Shading; public class CustomLabel : INodeLabel { public string GetLabel(INodeShadingContext context) { return context.DataSource; } } |
Nodes Coordinates
Code Block | ||
---|---|---|
| ||
using System; using Alastri.HaulInfinity.ScriptExtensions.Shading; public class CustomLabel : INodeLabel { public string GetLabel(INodeShadingContext context) { return return"(" + context.X.ToString("#,##0.00") + "\n | " + context.Y.ToString("#,##0.00") + "\n | " + context.Z.ToString("#,##0.00") + ")"; } } |