how to make index counter

Discussion in 'AutoCAD' started by Guest, Sep 25, 2004.

  1. Guest

    Guest Guest

    how to make index counter for listbox, starting 0 1 2... and so on,
    let say for layers

    dim LayerName as Acadlayer
    dim Index as Integer
    for each LayerName in thisdrawing.layers
    ListBox1.Additem LayerName.Name
    index = index + 1 ;this is right way
    .......
    .......
    next

    end sub
     
    Guest, Sep 25, 2004
    #1
  2. something like this....

    Dim objLayer As AcadLayer
    Dim j As Integer: j = 0
    For Each objLayer In ThisDrawing.Layers
    ListBox1.AddItem Str(j) + ": " + objLayer.Name
    j = j + 1
    Next objLayer

    cheers...
     
    Paul Richardson, Sep 25, 2004
    #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.