deleting all entities from specific layer

Discussion in 'AutoCAD' started by Craig Barrett, May 24, 2004.

  1. How do I delete all 3d polylines on a specific layer? I've tried using the
    following to select the 3d polylines but it does not work.


    iFilterType(0) = 0
    vFilterData(0) = "3dpolyline"
    iFilterType(1) = 8
    vFilterData(1) = "subbasin-temp"
    On Error Resume Next
    ThisDrawing.SelectionSets("3dpolyline").Delete
    Set oSS = ThisDrawing.SelectionSets.Add("3dpolyline")
    oSS.SelectOnScreen iFilterType, vFilterData

    Thanks,
    Craig
     
    Craig Barrett, May 24, 2004
    #1
  2. Craig Barrett

    john coon Guest

    Craig,

    This should delete all elements on a named layer

    Have a great day.
    John Coon

    Public Sub eraselayer()
    Dim ent As AcadEntity
    For Each ent In ThisDrawing.ModelSpace
    If ent.Layer = "P-ELEC-DUCT" Then '
    ent.Delete
    End If
    Next
    End Sub
     
    john coon, May 24, 2004
    #2
  3. Craig Barrett

    Anthony Ryan Guest

    The only way that I know of (and probably the longest) is to loop
    through all the entities and test for the layer that you are after,
    then delete the entity as you go.

    Anthony
     
    Anthony Ryan, May 24, 2004
    #3
  4. Try this. I never programmed LISP so I never had to learn the gory details
    of the ACAD database well enough to know exactly what this is doing, but I
    know enough to be able to borrow from
    http://groups.google.com/groups?threadm=
    :)

    iFilterType(0) = 0
    vFilterData(0) = "POLYLINE, LWPOLYLINE"
    iFilterType(1) = -4
    vFilterData(1) = "&" ' bitwise and
    iFilterType(2) = 70
    vFilterData(2) = 8

    HTH,

    James
     
    James Belshan, May 24, 2004
    #4
  5. Thanks for your help...
     
    Craig Barrett, May 25, 2004
    #5
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.