Layer Deletion

Hello.

I'm new to bricsCad, and therefor i'm seeking coding support.

I'm trying to delete a layer trough c# code but I can't find a way on how todo it.
The sample i found in the bricscad Dev Referance do's not seem to work.

Sample Code:
------------------------------------------
Sub Delete_Example()' This example creates a Layer named by the user.' It then deletes the layer.    Dim newLayer As AcadLayer    Dim lName As String    lName = InputBox("Type a layer name")    ' Create the new layer    Set newLayer = ThisDrawing.Layers.Add(lName)    MsgBox "Layer " & newLayer.Name & " has been added."    ' Delete the layer    lName = newLayer.Name    newLayer.Delete    MsgBox "Layer " & lName & " has been deleted."End Sub
-----------------------------
Can anyone direct me in the right direction on where i have to look or provide a sample?

Regards  and thanks in advance!