Name property example

Sub Name_Example()
' This example creates a new layer. It then changes the name of that layer.
    Dim layerObj As AcadLayer
    Set layerObj = ThisDrawing.Layers.Add("NewLayer")
    Dim sLayerName As String
    sLayerName = layerObj.Name
    MsgBox "A new layer was created with the name: " & sLayerName
    layerObj.Name= "TEST"
    sLayerName = layerObj.Name
    MsgBox "The new name of the layer is: " & layerObj.Name
End Sub

© Bricsys NV. All rights reserved.