delete layer

Discussion in 'AutoCAD' started by shubhada31, Jul 24, 2003.

  1. shubhada31

    shubhada31 Guest

    Hi All ,
    How can I delete frozen and off layer
    I have tried ...

    For index =0 to acadDoc.Layers.count -1
    acadDoc.Layers(index).delete
    next index

    but does not work as AutoCAD reindexes the layers .

    Is there any other way ..or either in AutoLISP or VB

    any help in this is welcome !!
    thanks
    S
     
    shubhada31, Jul 24, 2003
    #1
  2. shubhada31

    Kevin Terry Guest

    Try this:



    Dim acLayer as Layer



    for each acLayer in thisdrawing.Layers



        if acLayer.Freeze and not acLayer.LayerOn then



            acLayer.Delete



        end if



    next




    Kevin



    "shubhada31" <> wrote in message news:...

    Hi All ,
    How can I delete frozen and off layer
    I have tried ...

    For index =0 to acadDoc.Layers.count -1
    acadDoc.Layers(index).delete
    next index

    but does not work as AutoCAD reindexes the layers .

    Is there any other way ..or either in AutoLISP or VB

    any help in this is welcome !!
    thanks
    S
     
    Kevin Terry, Jul 24, 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.