Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

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.


Adding Custom Label

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

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

  3. Rename the label as desired.

  4. Paste the sample formula into the code editor window.

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

  6. Press OK to finish.

  7. Select the newly added label from the Label: field dropdown.

  8. To view the label, make sure you the Labels eye toggle is enabled.

Segments Distance Label

using System;
using Alastri.HaulInfinity.ScriptExtensions.Shading;

public class CustomLabel : ISegmentLabel
{         
    public string GetLabel(ISegmentShadingContext context)
    {
        return (context.Distance).ToString("#,##0.00") + " m"; 

    }
}

Blocks Auto Joins Number

using System;
using Alastri.HaulInfinity.ScriptExtensions.Shading;

public class CustomLabel : IBlockLabel
{         
    public string GetLabel(IBlockShadingContext context)
    {
        return  (context.AutoJoinCount).ToString(); 
    }
}

Nodes Data Source

using System;
using Alastri.HaulInfinity.ScriptExtensions.Shading;

public class CustomLabel : INodeLabel
{         
    public string GetLabel(INodeShadingContext context)
    {
        return context.DataSource;
    }
}


Nodes Coordinates

using System;
using Alastri.HaulInfinity.ScriptExtensions.Shading;

public class CustomLabel : INodeLabel
{         
    public string GetLabel(INodeShadingContext context)
    {
	return "(" + context.X.ToString("#,##0.00") + " | " + context.Y.ToString("#,##0.00") + " | " + context.Z.ToString("#,##0.00") + ")";
    }
}

  • No labels