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

Bricscad™ is commercialized by Bricsys NV. Bricsys NV and Vondle NV are fully owned subsidiaries of Menhirs NV. Copyright © 2001- Menhirs NV - All rights reserved.