Layers

A Layer can only be used in the 3D window and allows a group of equipment to be attached to a layer such that the visibility of this equipment can be controlled easily.

 

Array GetLayers()

A new function in V6.3 that returns an array of all the Layer names used in a project

Parameters: None

Return: An array of all Layer names in the project

 

Example:

var aLayers = GetLayers();
for (var i=0; i < aLayers.length; i++) {
   LogDebug("Layer " + i + " is " + aLayers[i]);
}

If there are no Layers defined in the Project the array will always return one entry of 'Background'.

string .GetLayer()

A new property in V6.3 that returns the Name of the Layer the specified equipment is assigned to. If the equipment is not assigned then it will default to 'Background'.

Parameters: None

Returns: The Layer name that the equipment is on

 

Example:

var oConv = GetComponentByNameAndType("Conveyor1", "Conveyor");
LogDebug("Conveyor "  + oConv.Name+ " is on layer " + oConv.GetLayer());