Delete method example

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

© Bricsys NV. All rights reserved.