Please Help: layer prefix script doesn't work for v5 sublayer

Hi Micha- this seems to handle the nesting correctly- does that do what you need?

_-Runscript(
Option Explicit

Call LayerPrefix()

Sub LayerPrefix()

	Dim arrAllLayers, arrSelLayers, strLayer, strPrefix, strSuffix

	arrAllLayers = Rhino.LayerNames
	
	arrSelLayers = Rhino.MultiListBox(arrAllLayers, "Select layers to rename:", "Rename Layers")
	If isnull(arrSelLayers) Then Exit Sub
	
	strPrefix = Rhino.GetString("Prefix? (ENTER to skip)")
	If isnull(strPrefix) Then Exit Sub

	
	strSuffix = Rhino.GetString("Suffix? (ENTER to skip)")
	If isnull(strSuffix) Then Exit Sub


	If strPrefix = "" And strSuffix = "" Then Exit Sub
	Dim arrID, aNames, n, i, Bound
	Bound = UBound(arrSellayers)
	n = 0
	ReDim arrID(Bound)
	ReDim aNames(Bound)
	
	For Each strLayer In arrSelLayers
		arrID(n) = Rhino.LayerId(strLayer)
		aNames(n) = strPrefix & GetShortName(arrID(n)) & strSuffix
		n = n + 1
	Next

	For i = 0 To n - 1
		
		Call Rhino.RenameLayer(arrId(i), aNames(i))
	Next
	
End Sub


Function GetShortName(ID)
	Dim sLayer: sLayer = Rhino.LayerName(ID)
	'Return the short layer name from a full nested layer path.
	Dim intLast: intLast = instrRev(sLayer, chr(58) & chr(58))
	If intLast = 0 Then
		GetShortName = slayer
		Exit Function
	End If
	GetShortName = Right(slayer, len(slayer) - (intLast + 1))
	Rhino.Print Right(slayer, len(slayer) - intLast)
	
End Function

)