List of Layers

Discussion in 'AutoCAD' started by keithwaite, Sep 18, 2003.

  1. keithwaite

    keithwaite Guest

    I have a ListBox on a form that shows me all the layers that exist in my drawing. Is there a way that I can have it tell me if the layer is On/Off, Froze/Thawed? These are the only two options I want to know about.

    I also have buttons that can toggle the highlighted layer On/Off or Frozeen/Thaw, but I have no way of telling if it is Frozen or Thawed.

    Thanks,
    Keith
     
    keithwaite, Sep 18, 2003
    #1
  2. keithwaite

    keithwaite Guest

    I figured it out... see below.

    Private Sub lstBox_Click()
        Dim layerObj As AcadLayer
        Set layerObj = ThisDrawing.Layers.Item(lstBox.Text)
          'Display Frozen or Thawed in Label box.
           If layerObj.Freeze Then
               lblForT.Caption = "Frozen"
           Else
               lblForT.Caption = "Thawed"
           End If
    End Sub
     
    keithwaite, Sep 18, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.